Upgrade to 0.9 breaks file-loader. Can't load svgs.
See original GitHub issue- Laravel Mix Version: 0.9.2
- Node Version (
node -v
): v6.9.2 - NPM Version (
npm -v
): 3.10.9 - OS: Windows 10
Description:
error in ./resources/assets/svg/zondicons/close.svg
Module build failed: TypeError: url.replace is not a function
at Object.interpolateName (C:\app\ln\node_modules\loader-utils\index.js:276:13)
at Object.module.exports (C:\app\ln\node_modules\file-loader\index.js:30:24)
@ ./~/babel-loader/lib?cacheDirectory!./~/vue-loader/lib/selector.js?type=script&index=0!./resources/assets/js/components/Datepicker/Datepicker.vue 21:0-57
@ ./resources/assets/js/components/Datepicker/Datepicker.vue
@ ./resources/assets/js/app.js
@ multi ./resources/assets/js/app.js
Steps To Reproduce:
import closeIcon from '../../../svg/zondicons/close.svg'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Upgrade to 0.9 breaks file-loader. Can't load svgs. #614 - GitHub
This was from a PR a few weeks ago. I believe it was because you can end up with vendor assets that have...
Read more >Jest cannot load svg file - Stack Overflow
svg files from an icon library in node_modules 1. Using jest-transform-stub in the "transform" section of jest.config.js did not work for me, ...
Read more >How to Import SVGs in a React and Vite app - freeCodeCamp
To do this, open up the SVG file in a text editor, and copy-paste the code into a new component: export const ArrowUndo...
Read more >svg files not loading Ubuntu 16.04 LTS - Beyond the Basics
Inkscape is essentially completely broken: The save/save as options under file do nothing, and I cannot import any images at all into Inkscape....
Read more >How to Load SVG with React and Webpack | Pluralsight
All we have to do is update our webpack configuration. The example below uses svgr and url-loader, a webpack loader which transforms files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Gotcha! After @manniL suggestion I figured this might something to do with differences in
node_modules
structure between yarn and npm. Therefore, temporarily switching to npm is another confirmed way to solve the issue.In the end, it seems like string replace here needs to be adjusted accordingly. Ping @KristofMorva.
@JeffreyWay On a second thought, this might have been avoided if Mix bumped
file-loader
version to 0.10.1 between releases. I’ll create pull request for this in a moment.