Closed supnim closed 4 years ago
Hi!
Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.
If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.
Thanks for using Gatsby! 💜
@LekoArts Thanks for getting back, ill try and set this up ASAP - much appreciate you looking into this for me. Link to follow, soon :)
@LekoArts here is the minimal repo, hope this helps
Thank you for opening this!
I figured out what your issue is however in the future I would appreciate if you followed our instructions for providing the minimal reproduction in more detail :) The project you showed was quite huge to download and had a lot of things going on. It's better to go from a hello-world
project like e.g. https://codesandbox.io/s/gatsby-gif-xt9ok
Your problem is the wrong usage of gatsby-plugin-react-svg
. In that part https://github.com/jacobmischka/gatsby-plugin-react-svg#configuration it says:
svg-react-loader will use them and url-loader will be re-enabled with the inverse.
So once you e.g. move your .gif out from the content/assets
directory into src/components
it works because then the plugin isn't messing with the url-loader
which is responsible for loading the files.
I also saw it working after removing gatsby-plugin-react-svg
completely (and temporarily replacing the svg imports with placeholders).
You should place your svg files into a single directory and strictly point gatsby-plugin-react-svg
to that.
On a side note: You shouldn't use the gif you were trying to use. It's 36MB big. Use a video instead ;)
We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!
@LekoArts thanks you sooooo much, truly appreciate it. Sorry about the bad repo, my bad. once again thanks, brother! all the best :)
Summary
Hello, I come asking for help – I've spent a whole day trying to figure it out now. I can't seem to figure out how to get gifs to load on my site. (I'm pretty new to coding so forgive me if this something obvious)
location: src/page/volvic
bring them in like so: import volvic from "../../content/assets/projects/volic.gif"
and call it like so:
<img src={volvic} />
gives me this error: (terminal)
––––– (localhost)
./content/assets/projects/volvic.gif 1:6Module parse failed: Unexpected character '' (1:6)You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders(Source code omitted for this binary file)
Can someone point me the right direction please, any help would be greatly appreciated.
Environment (if relevant)
https://github.com/supnim/new-port - repo OS: macOS 10.16 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Shell: 5.8 - /bin/zsh Binaries: Node: 14.4.0 - /usr/local/bin/node npm: 6.14.5 - /usr/local/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 81.0.4044.138 Safari: 14.0 npmPackages: gatsby: ^2.23.4 => 2.23.4 gatsby-image: ^2.4.12 => 2.4.12 gatsby-plugin-feed: ^2.5.5 => 2.5.5 gatsby-plugin-google-analytics: ^2.3.4 => 2.3.4 gatsby-plugin-manifest: ^2.4.11 => 2.4.11 gatsby-plugin-netlify: ^2.3.5 => 2.3.5 gatsby-plugin-offline: ^2.1.0 => 2.2.10 gatsby-plugin-postcss: ^2.3.4 => 2.3.4 gatsby-plugin-purgecss: ^3.1.1 => 3.1.1 gatsby-plugin-react-helmet: ^3.3.4 => 3.3.4 gatsby-plugin-react-svg: ^3.0.0 => 3.0.0 gatsby-plugin-sass: ^2.3.4 => 2.3.4 gatsby-plugin-sharp: ^2.6.17 => 2.6.17 gatsby-plugin-smoothscroll: ^1.1.0 => 1.1.0 gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4 gatsby-remark-copy-linked-files: ^2.3.10 => 2.3.10 gatsby-remark-embed-video: ^2.0.1 => 2.0.1 gatsby-remark-images: ^2.0.6 => 2.0.6 gatsby-remark-prismjs: ^3.5.4 => 3.5.4 gatsby-remark-responsive-iframe: ^2.4.5 => 2.4.5 gatsby-remark-smartypants: ^2.3.4 => 2.3.4 gatsby-source-filesystem: ^2.3.11 => 2.3.11 gatsby-transformer-remark: ^2.8.16 => 2.8.16 gatsby-transformer-sharp: ^2.5.10 => 2.5.10 npmGlobalPackages: gatsby-cli: 2.12.58
File contents (if changed)
gatsby-config.js:
package.json:
Once again any help would be highly appreciated :)