When requiring an image path I have to add .default
See original GitHub issueWhen importing an SVG I can require the path just fine
src={require("../assets/svg/dij-slash.svg")}
But when importing a jpg
I have to import it like this:
image={require("../assets/img/content/diensten-support.jpg").default}
Notice the .default
at the end. Is this intended?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Default image if no record with image path on database
we can try set by-default value to database column img_local (Ex. default.png) , so if user not change image or there is no...
Read more >Default 'insert image' path? - Adobe Support Community
I quickly setup a toolbar with just 'Insert Image' & 'Create DD Hotspot' buttons, and flip between CTRL+G and the toolbar for images...
Read more >Default image path | Drupal.org
I am new to Drupal. I am struggling with quite a few things but my present major one is defining the Default Image...
Read more >How to require() a image only if it exist or else ... - Vue Forum
Hi, I 'm new to vue.js, nuxt.js, webpack tooling. ... let defaultImage = "@/assets/img/beer-default.png" // just set default let path ...
Read more >Require Image Not Working in ReactJS - YouTube
I have got images folder with images in it. I recently noticed react require ... We can resolve it by adding default after...
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
Found this happening for images that are not inlined, either because they are too large or because ?url is set. Filetype doesn’t seem to matter, happening with SVGs too. Quite problematic because the image can break when its file size changes. Tested in 2.5.8-canary.1
This isn’t fixed issue for me, but I’ve fixed it by disabling fallback to url-loader through option
inlineImageLimit: -1
. Think there may be issue with url-loader’s default config?