-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug]: potrace fails randomly with "cannot read property bitmap of undefined" #12552
Comments
Additional information: today I saw this error on a Netlify build. After hitting "retry build" it worked. So this issue affects not only |
@baobabKoodaa that's not a gatsby error per se. The problem is Potrace package throwing a "fit", i've been observing the behaviour while answering some issues that popped up around here ranging from people with markdown issues to simple image import issues. While i was coming up with a code reproduction for those people, I've seen that package throw that exact error with .png files, to .jpg files above 1 MB for instance. And if i'm not mistaken this issue is one that's been appearing on and off since version 1.x.x |
Wow, that's surprising. I thought it must be a concurrency issue with multiple Gatsby plugins doing things to images concurrently. |
I just started experiencing it this week. This has been a killer of my productivity. I'd love any possible workaround, even temporary |
^ My bad, sorry! |
Can any of you share site you are seeing this problem with? I was able to kind of reproduce it (but I needed to disable memoization that we use, which should exactly prevent this problem). |
Few notes for anyone who could be interested in tracking this down - this is changes I made in gatsby-plugin-sharp to disable memoization: And this is custom code to excisively call not memoized
This crashes after some random time with exact same error. Adding some logging to
produce (example) output:
which does seem like problem with potentially gatsby writing to same temporary file multiple times concurrently This should not happen unless memoization is failing, so samples of sites that are known to produce this problem would be extremely helpful as then we could verify memoization keys vs tmp file paths. |
I can't reliably reproduce it, but this is the site that I'm working on which occasionally throws this error: https://github.com/baobabKoodaa/blog |
just a theory, but could it be that there are conflicting job IDs in the reducer for each task in you'd think that maybe the id should contain the anyways, we're seeing the same issue pop up now and then but haven't been able to repro consistantly |
I had this issue in a project querying Contentful images. |
This looks very similar to #8301, so let's continue the discussion there. Thanks everyone! |
I opened #12927 PR that hopefully fixes that. Because of random nature of this errors I can't be 100% sure on this |
Hey guys, not sure if that will help, but I'm having same issue, when I'm querying images from Contentful. I've managed to narrow it down to this situation:
Looks pretty random. If you need more info let me know. Hope that helps. |
in my case, JIMP (used by Potrace) throws an error because it doens't support webp. And Potrace doesn't handle this error. I've created a bug report in Potrace project: tooolbox/node-potrace#8 |
Still happening to me with latest versions; I got my builds to work by changing "GatsbyImageSharpFluid. tracedSVG" to "GatsbyImageSharpFluid". I think #8301 was closed prematurely? |
I can confirm this still happens with the following:
I was able to build using @dbvisel workaround. Was also using "GatsbyImageSharpFluid_tracedSVG" fragment. |
I just got this issue when trying GatsbyImageSharpFluid_tracedSVG anyone solves this? |
Solution: remove all
If you still encountered the same error, try moving the original |
remove tracedSVG with gatsby.config.js |
Genius |
I stopped using the tracedSVG option and replaced it with Blurred
--- with
|
@abheist's solution worked for me. Thank you! |
Running
gatsby develop
works most of the time, but I randomly get this error. It seems that I'm more likely to get the error after runninggatsby clean
. Today I rangatsby develop
3 times in a row with no changes to anything. The first 2 times I got this error and the 3rd time it worked.The text was updated successfully, but these errors were encountered: