-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I recently upgraded an app from webpacker 4 -> 5. When I did that my "fontawesome" icons went away. I found the font was not loading despite being in the static_assets_extensions. When I looked at the compiled CSS it looked like:
@font-face {
font-family: 'FontAwesome';
src: url([object Module]);
src: url("[object Module]?#iefix&v=4.7.0") format("embedded-opentype"), url([object Module]) format("woff2"), url([object Module]) format("woff"), url([object Module]) format("truetype"), url("[object Module]#fontawesomeregular") I did a search and found a related issue on stack overflow that indicates adding esModule: false to the fileloader options:
https://stackoverflow.com/questions/57671995/webpack-4-gives-background-urlobject-module-as-bg-image
I looked at the file-loader package and it appears in v5 they made a breaking change documented as:
switch to ES modules by default (the option esModule is true by default)
Since the file-loader config is controlled by webpacker making that config change would not be easy to do. Instead I downgraded to version 4.3 of file-loader and things are now working fine.
Seems either webpacker needs to be updated to use this esModule: false option or some other change needs to be made so it is compat with the new way file-loader is doing things.