question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
adiachenkocommented, Mar 24, 2017

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.

0reactions
adiachenkocommented, Mar 25, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found