[GH-ISSUE #725] WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/na.svg #378

Closed
opened 2026-03-03 14:37:57 +03:00 by kerem · 10 comments
Owner

Originally created by @goxr3plus on GitHub (Jun 9, 2020).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/725

I just installed from npm used it it works but my console is full of these annoying warnings .... ? @jorgelf

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ng.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ni.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nl.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/no.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/np.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nr.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nu.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nz.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/om.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pa.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pe.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pf.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pg.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ph.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pk.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pl.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pm.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pn.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pr.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ps.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pt.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pw.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/py.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/qa.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/re.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ro.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/rs.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ru.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/rw.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sa.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sb.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sc.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sd.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/se.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sg.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sh.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/si.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sj.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sk.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sl.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sm.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sn.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/so.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sr.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ss.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/st.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sv.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sx.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sy.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sz.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tc.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/td.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tf.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tg.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/th.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tj.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tk.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tl.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tm.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tn.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/to.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tr.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tt.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tv.svg

WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tw.svg
Originally created by @goxr3plus on GitHub (Jun 9, 2020). Original GitHub issue: https://github.com/lipis/flag-icons/issues/725 I just installed from npm used it it works but my console is full of these annoying warnings .... ? @jorgelf ``` JAVA WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ng.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ni.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nl.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/no.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/np.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nr.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nu.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/nz.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/om.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pa.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pe.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pf.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pg.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ph.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pk.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pl.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pm.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pn.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pr.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ps.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pt.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/pw.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/py.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/qa.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/re.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ro.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/rs.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ru.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/rw.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sa.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sb.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sc.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sd.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/se.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sg.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sh.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/si.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sj.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sk.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sl.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sm.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sn.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/so.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sr.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/ss.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/st.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sv.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sx.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sy.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/sz.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tc.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/td.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tf.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tg.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/th.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tj.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tk.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tl.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tm.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tn.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/to.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tr.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tt.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tv.svg WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/tw.svg ```
kerem closed this issue 2026-03-03 14:37:57 +03:00
Author
Owner

@jorgelf commented on GitHub (Jun 9, 2020):

This can't be related to my pull request as the latest npm version is from 4 months ago. Hope @lipis can provide more info.

<!-- gh-comment-id:641154264 --> @jorgelf commented on GitHub (Jun 9, 2020): This can't be related to my pull request as the latest npm version is from 4 months ago. Hope @lipis can provide more info.
Author
Owner

@Findus23 commented on GitHub (Jun 9, 2020):

Hi,

Where do you see this error? This repo does neither contain a media nor a fonts directory, so I assume you have something like webpack set up to store files somewhere like /some/path/[filename].[extension] and as there are two files in the repo with the same name for each flag, the second one is overwriting the first one and you need to configure your build process to respect the parent directory of the file.

<!-- gh-comment-id:641195925 --> @Findus23 commented on GitHub (Jun 9, 2020): Hi, Where do you see this error? This repo does neither contain a media nor a fonts directory, so I assume you have something like webpack set up to store files somewhere like /some/path/[filename].[extension] and as there are two files in the repo with the same name for each flag, the second one is overwriting the first one and you need to configure your build process to respect the parent directory of the file.
Author
Owner

@lipis commented on GitHub (Jun 10, 2020):

I just released a new version and can't reproduce this error..

<!-- gh-comment-id:641954483 --> @lipis commented on GitHub (Jun 10, 2020): I just released a new version and can't reproduce this error..
Author
Owner

@jorgelf commented on GitHub (Jun 10, 2020):

I agree with @Findus23, this looks related to your environment and/or other packages. Can you try installing it solely in a clean location and check if the warnings keep appearing?

<!-- gh-comment-id:641956926 --> @jorgelf commented on GitHub (Jun 10, 2020): I agree with @Findus23, this looks related to your environment and/or other packages. Can you try installing it solely in a clean location and check if the warnings keep appearing?
Author
Owner

@goxr3plus commented on GitHub (Jun 11, 2020):

Hi,

Where do you see this error? This repo does neither contain a media nor a fonts directory, so I assume you have something like webpack set up to store files somewhere like /some/path/[filename].[extension] and as there are two files in the repo with the same name for each flag, the second one is overwriting the first one and you need to configure your build process to respect the parent directory of the file.

Yes i am using it in a React with WebPack project , what can i do :) ?

<!-- gh-comment-id:642528274 --> @goxr3plus commented on GitHub (Jun 11, 2020): > Hi, > > Where do you see this error? This repo does neither contain a media nor a fonts directory, so I assume you have something like webpack set up to store files somewhere like /some/path/[filename].[extension] and as there are two files in the repo with the same name for each flag, the second one is overwriting the first one and you need to configure your build process to respect the parent directory of the file. Yes i am using it in a React with WebPack project , what can i do :) ?
Author
Owner

@goxr3plus commented on GitHub (Jun 11, 2020):

Here is my webpack.config.js

const webpack = require('webpack')
const path = require('path')

// ---------------------- Variables ----------------------
const nodeEnv = process.env.NODE_ENV || 'development'
const publicServePath = nodeEnv === 'production' ? '/public/' : 'http://localhost:3000/public/'

const buildPath = path.join(__dirname, './src/server/public')

module.exports = {
   target: 'web',
   output: {
      path: buildPath,
      filename: '[name].js',
      publicPath: publicServePath
   },

   module: {
      rules: [
         {
            test: /\.(js|jsx)$/,
            use: {
               loader: 'babel-loader'
            },
            exclude: /node_modules/
         },
         {
            test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
            use: { loader: 'file-loader?name=media/fonts/[name].[ext]' }
         },
         {
            test: /\.(png|jpe?g|gif|ico)$/,
            use: { loader: 'file-loader?name=assets/[name].[hash].[ext]' }
         }
      ]
   },
   resolve: {
      extensions: ['.webpack-loader.js', '.web-loader.js', '.loader.js', '.js', '.jsx'],
      alias: {
         'react-dom': '@hot-loader/react-dom'
      }
   },
   plugins: [
      new webpack.NamedModulesPlugin(),
      new webpack.DefinePlugin({
         'process.env': {
            NODE_ENV: JSON.stringify(nodeEnv)
         }
      })
   ],
   optimization: {
      splitChunks: {
         cacheGroups: {
            vendor: {
               test: /node_modules/,
               chunks: 'initial',
               name: 'vendor',
               priority: 10,
               enforce: true
            }
         }
      }
   }
}

and webpack.dev.js :

const webpack = require('webpack')
const merge = require('webpack-merge')
const path = require('path')
const common = require('./webpack.config.js')

const devServerPort = 3000

module.exports = merge(common, {
   mode: 'development',
   entry: {
      bundle: [`webpack-dev-server/client?http://localhost:${devServerPort}`, 'webpack/hot/dev-server', './src/client/index.jsx']
   },
   module: {
      rules: [
         {
            test: /\.(scss|css)$/,
            use: [
               { loader: 'style-loader' },
               { loader: 'css-loader', options: { sourceMap: true } },
               { loader: 'sass-loader', options: { sourceMap: true } }
            ]
         }
      ]
   },
   plugins: [new webpack.HotModuleReplacementPlugin()],
   devServer: {
      contentBase: path.join(__dirname, './src/client'),
      historyApiFallback: true,
      port: devServerPort,
      compress: false,
      inline: false,
      hot: true,
      host: '0.0.0.0',
      publicPath: '/public/',
      headers: { 'Access-Control-Allow-Origin': '*' },
      disableHostCheck: true,
      stats: {
         colors: true,
         assets: true,
         version: false,
         hash: false,
         timings: true,
         chunks: false,
         chunkModules: false
      }
   },
   devtool: 'inline-source-map'
})

<!-- gh-comment-id:642528837 --> @goxr3plus commented on GitHub (Jun 11, 2020): Here is my webpack.config.js ``` JAVA const webpack = require('webpack') const path = require('path') // ---------------------- Variables ---------------------- const nodeEnv = process.env.NODE_ENV || 'development' const publicServePath = nodeEnv === 'production' ? '/public/' : 'http://localhost:3000/public/' const buildPath = path.join(__dirname, './src/server/public') module.exports = { target: 'web', output: { path: buildPath, filename: '[name].js', publicPath: publicServePath }, module: { rules: [ { test: /\.(js|jsx)$/, use: { loader: 'babel-loader' }, exclude: /node_modules/ }, { test: /\.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/, use: { loader: 'file-loader?name=media/fonts/[name].[ext]' } }, { test: /\.(png|jpe?g|gif|ico)$/, use: { loader: 'file-loader?name=assets/[name].[hash].[ext]' } } ] }, resolve: { extensions: ['.webpack-loader.js', '.web-loader.js', '.loader.js', '.js', '.jsx'], alias: { 'react-dom': '@hot-loader/react-dom' } }, plugins: [ new webpack.NamedModulesPlugin(), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }) ], optimization: { splitChunks: { cacheGroups: { vendor: { test: /node_modules/, chunks: 'initial', name: 'vendor', priority: 10, enforce: true } } } } } ``` and webpack.dev.js : ``` JAVA const webpack = require('webpack') const merge = require('webpack-merge') const path = require('path') const common = require('./webpack.config.js') const devServerPort = 3000 module.exports = merge(common, { mode: 'development', entry: { bundle: [`webpack-dev-server/client?http://localhost:${devServerPort}`, 'webpack/hot/dev-server', './src/client/index.jsx'] }, module: { rules: [ { test: /\.(scss|css)$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader', options: { sourceMap: true } }, { loader: 'sass-loader', options: { sourceMap: true } } ] } ] }, plugins: [new webpack.HotModuleReplacementPlugin()], devServer: { contentBase: path.join(__dirname, './src/client'), historyApiFallback: true, port: devServerPort, compress: false, inline: false, hot: true, host: '0.0.0.0', publicPath: '/public/', headers: { 'Access-Control-Allow-Origin': '*' }, disableHostCheck: true, stats: { colors: true, assets: true, version: false, hash: false, timings: true, chunks: false, chunkModules: false } }, devtool: 'inline-source-map' }) ```
Author
Owner

@Rendrik commented on GitHub (Jun 11, 2020):

@goxr3plus I was having this issue in Webpack as well. It stems from a combination of using the file loader, and this library. There are two sets of flags in different folders: 1x1, and 4x3. The filenames however are the same. Using your settings, Webpack will happily take all of them and slap them in media/fonts/[name].[ext] at which point they will be stepping on eachother's toes.

There's many ways around this. But the root of it is when using file-loader, you need to ensure the name/path is unique. So you could add the path in: media/fonts/[path][name].[ext], but that will result in something like media/fonts/node_modules/flag-icon-css/flags/4x3/yt.svg.
Another solution is to add some other uniqueness to it like a hash.

But the point is the root of the problem is the way file-loader is being used, and it's not really a problem with this NPM library.

<!-- gh-comment-id:642973367 --> @Rendrik commented on GitHub (Jun 11, 2020): @goxr3plus I was having this issue in Webpack as well. It stems from a combination of using the file loader, and this library. There are two sets of flags in different folders: 1x1, and 4x3. The filenames however are the same. Using your settings, Webpack will happily take all of them and slap them in `media/fonts/[name].[ext]` at which point they will be stepping on eachother's toes. There's many ways around this. But the root of it is when using file-loader, you need to ensure the name/path is unique. So you could add the path in: `media/fonts/[path][name].[ext]`, but that will result in something like `media/fonts/node_modules/flag-icon-css/flags/4x3/yt.svg`. Another solution is to add some other uniqueness to it like a hash. But the point is the root of the problem is the way file-loader is being used, and it's not really a problem with this NPM library.
Author
Owner

@goxr3plus commented on GitHub (Jun 12, 2020):

@Rendrik So for example with the given Webpack I have can you suggest me the simplest solution. I mean giving me one or two lines of code that will work. I read your two different solution but I don't know how to translate into Webpack code.

I am kind of very new in the world of Webpack :)

Thank you ♥️

<!-- gh-comment-id:643096815 --> @goxr3plus commented on GitHub (Jun 12, 2020): @Rendrik So for example with the given Webpack I have can you suggest me the simplest solution. I mean giving me one or two lines of code that will work. I read your two different solution but I don't know how to translate into Webpack code. I am kind of very new in the world of Webpack :) Thank you ♥️
Author
Owner

@Rendrik commented on GitHub (Jun 12, 2020):

@goxr3plus This line in your webpack config:
use: { loader: 'file-loader?name=media/fonts/[name].[ext]' } You can make it unique by adding hash like so use: { loader: 'file-loader?name=media/fonts/[name]-[contenthash].[ext]' }.

You can also not specify the name at all, and set just the output path to /media/fonts. Webpack will automatically name each file with only a hash.
You can read about output path and the other options on the webpack file-loader page.

<!-- gh-comment-id:643395954 --> @Rendrik commented on GitHub (Jun 12, 2020): @goxr3plus This line in your webpack config: `use: { loader: 'file-loader?name=media/fonts/[name].[ext]' }` You can make it unique by adding hash like so `use: { loader: 'file-loader?name=media/fonts/[name]-[contenthash].[ext]' }`. You can also not specify the name at all, and set just the output path to /media/fonts. Webpack will automatically name each file with only a hash. You can read about output path and the other options on the [webpack file-loader page](https://webpack.js.org/loaders/file-loader/).
Author
Owner

@goxr3plus commented on GitHub (Jun 13, 2020):

Thank you very much I will try and come back here to close :)

<!-- gh-comment-id:643675212 --> @goxr3plus commented on GitHub (Jun 13, 2020): Thank you very much I will try and come back here to close :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#378
No description provided.