Replies: 7 comments
-
Similar issue here since upgrading this morning, but the error is |
Beta Was this translation helpful? Give feedback.
-
I had this issue when trying to pass a prop value into |
Beta Was this translation helpful? Give feedback.
-
@LekoArts , is it possible to fix this issue, modifying the writeImages function (images-processing file)? I can think about adding some logic for handling the absence of src. If this is possible, can I work on this issue? |
Beta Was this translation helpful? Give feedback.
This comment has been minimized.
This comment has been minimized.
-
I was getting this issue because I was trying to pass in an image that I got from my I had this in my static query:
This won't work:
This will work:
Once I used a normal img tag, the problem went away. |
Beta Was this translation helpful? Give feedback.
-
Asked this on StackOverflow: "Gatsby plugin image cannot read property 'startsWith'". At the current moment I'm unable to get |
Beta Was this translation helpful? Give feedback.
-
Please check your code, until #30271 is merged and released you'll see this error instead of a more detailed one where your user error lies. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Builds are failing since I've updated to gatsby-plugin-image, because it seems like one image does not have a valid src when processed. The terminal displays this:
I've added
console.log(filename, [...images.entries()]);
innode_modules/gatsby-plugin-image/dist/node-apis/image-processing.js
before the call towriteImages
, and it's showing:/path/to/my/image/component.tsx, [ [ '2298356842', {} ] ]
So there is an image hash, but no properties (including the src). And the code of
writeImages
does not take into account this scenario.I've tried to clear the cache and delete node_modules, to no avail.
Any idea how I could identify the culprit file with just the hash? For now I'm using a quick workaround, by returning at the beginning of the map function, if src is undefined (line 86 of this file)
Steps to reproduce
Unfortunately I didn't managed to get reproduction repo working yet, I'm gonna try soon to migrate another website with a smaller yet very similar codebase.
Expected result
If there is an issue with an image src at build time, it should not fail but just warn.
Actual result
Build is failing, and the output does not give much informations to debug further.
Environment
Beta Was this translation helpful? Give feedback.
All reactions