svg-sprite-loader: Import of SVG-file fails with extraction (returns undefined)

With my current build-process, the import of an SVG-file returns undefined when extraction is turned on. with { extract: off } it returns an object as expected per documentation.

I have created a reduced test-case, which I will hope assist the debugging process.

Details of my setup:

  • Windows 10
  • Node v. 7.2.1 See package.json for further details.

To Reproduce:

  • Download the test-case and install dependencies.
  • Start up the project with npm start. This should launch your web-browser at http://localhost:3000.
  • Open the console, and see that undefined is logged by Shell.vue:12, which attempts to log the import of ./assets/arrow.svg.
  • In build/webpack.base.conf.js:59, set extract: true and run the build process again.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Got it, it’s Windows path resolving issue. I will have access to Windows machine tomorrow, stay tuned!

That strange. Could you push latest changes in your repo so I can check?

I think I understand what you want - svg image should goes to external sprite, but symbol (SpriteSymbol<id: string, viewBox: string, content: string>) should returns from import statement instead of symbol url. Am I right?