mirror of
https://github.com/lipis/flag-icons.git
synced 2026-04-26 09:25:50 +03:00
[GH-ISSUE #725] WARNING in Conflict: Multiple assets emit different content to the same filename media/fonts/na.svg #378
Labels
No labels
3rd-party
3rd-party
bug
code
documentation
enhancement
fixed-in-master
flag-request
help needed
missing-flag
missing-flag
pull-request
wrong-flag
wrong-flag
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/flag-icons#378
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
@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.
@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.
@lipis commented on GitHub (Jun 10, 2020):
I just released a new version and can't reproduce this error..
@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?
@goxr3plus commented on GitHub (Jun 11, 2020):
Yes i am using it in a React with WebPack project , what can i do :) ?
@goxr3plus commented on GitHub (Jun 11, 2020):
Here is my webpack.config.js
and webpack.dev.js :
@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 likemedia/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.
@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 ♥️
@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 souse: { 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.
@goxr3plus commented on GitHub (Jun 13, 2020):
Thank you very much I will try and come back here to close :)