Import of SVG-file fails with extraction (returns undefined)
See original GitHub issueWith 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 athttp://localhost:3000
. - Open the console, and see that
undefined
is logged byShell.vue:12
, which attempts to log theimport
of./assets/arrow.svg
. - In
build/webpack.base.conf.js:59
, setextract: true
and run the build process again.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
Getting undefined when importing svg as ReactComponent ...
To import an SVG: import MySvg from "MySvg.svg" which will save the ... The reason you get undefined is that you are destructuring...
Read more >How to use SVGs in React
There are a few ways to use an SVG in a React app: Use it as a regular image; Import it as a...
Read more >includesvg does not detect SVG file
Changing the relative path to an absolute one ( D:\Desktop\TEST\my-svg-file` in this case), leads to completely different errors: Log file ... !
Read more >MiniCssExtractPlugin
HMR is automatically supported in webpack 5. No need to configure it. Skip the following: The mini-css-extract-plugin supports hot reloading of actual css...
Read more >Oracle Digital Assistant Known Issues - Cloud
A webview error occurs when importing, cloning, or versioning a skill. Web SDK - If you return an undefined message in the beforeDisplay...
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
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?