mirror of
https://github.com/lipis/flag-icons.git
synced 2026-04-26 01:15:55 +03:00
[GH-ISSUE #1074] Images are displayed only in development environment #503
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#503
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 @msuliq on GitHub (Jan 17, 2023).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/1074
Hello, first of all, thanks for the awesome library!
I have found an issue when the flags do not render in production but render in development mode on my Rails 6 app.
Library is imported within application.scss file:
@import "flag-icons/css/flag-icons.min.css";My package.json looks like below:
{ "dependencies": { "@hotwired/stimulus": "^3.2.1", "@hotwired/turbo-rails": "^7.2.4", "@popperjs/core": "^2.9.3", "@rails/actioncable": "^6.0.0", "@rails/activestorage": "^6.0.0", "@rails/request.js": "^0.0.6", "@rails/ujs": "^7.0.0", "autoprefixer": "^10.4.0", "cssnano": "^5.1.7", "esbuild": "^0.14.8", "esbuild-rails": "^1.0.3", "events": "^3.3.0", "flag-icons": "^6.6.6", "jquery": "^3.6.0", "postcss": "^8.4.4", "postcss-advanced-variables": "^3.0.1", "postcss-assets": "^6.0.0", "postcss-cli": "^9.1.0", "postcss-copy-assets": "^0.3.1", "postcss-easy-import": "^3.0.0", "postcss-flexbugs-fixes": "^5.0.2", "postcss-import": "^14.0.2", "postcss-inline-svg": "^5.0.0", "postcss-nested": "^5.0.6", "postcss-nesting": "^10.1.0", "postcss-preset-env": "^7.0.1", "postcss-scss": "^4.0.2", "postcss-url": "^10.1.3", "sass": "^1.44.0", }, "version": "0.1.0", "scripts": { "build:css": "NODE_ENV=${RAILS_ENV:-development} postcss ./app/assets/stylesheets/application.scss -o ./app/assets/builds/application.css", "build": "NODE_ENV=${RAILS_ENV:-development} node esbuild.config.js" } }When I run
rake assets:precompilelocally, I get the following warnings:Regardless of the warning, the flags images are showing perfectly fine on my localhost, however, if I push these changes to a live server, the image files are not displayed. And are displayed only in case I add the flag icon .svg files into the
app/assets/flags/ directoryas mentioned in the warning.So far I am thinking that postcss is somehow involved in this issue but I am not completely confident about it.
Let me know if you need any additional information or clarifications.
Thank you in advance for your time and help, really appreciate it.
@DavidRecheni commented on GitHub (May 18, 2023):
Same issue here
Update:
Solved it by using the cdn instead of installing the library
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@6.6.6/css/flag-icons.min.css" />