gatsby: Number of generated thumbnails seems huge and crashes build in Windows
Somehow a website of mine that had been building without problems, today has failed during build after having added a couple of additional posts
After trying to increase/decrease versions of sharp
package and related plugins without success, I just upgraded all packages of my site just to see that both develop
and build
were failing
Then I just moved out all the site posts and develop
again, and it worked again, but without content of course
My hypothesis is that the number of generated thumbnails gets huge at a point that it crashes due to a sort of out-of-memory error
[====================----------] 13710/20646 439.4 s 66% Generating image thumbnailsException code=0xc0000005 flags=0x0 at 0x0000000000000000. Access violation - attempting to execute data at address 0x0000000000000000
error Command failed with exit code 3221225477.
Then, the question is how is this happening? In the sense that it wasn’t happening 1 week ago without any significant change
Then,
- If I run my site with a bunch of static images and some non-static images, some pages and just 1 post, I have this
498 thumbnails, from ~60 images, I don’t know if it is excessive but doesn’t seem super-excessive
Then if I add a second post that refers to a static image (that was already there), then I have this
747 thumbnails, this must be wrong
Then if I add 3 more posts
1328 thumbnails
Then if I add the 38 other posts, that before compiled well in Netlify, then I have this
7636 thumbnails
which causes a failure when it went by ~2400
All of this is running gatsby clean && gatsby develop
, so that cache and public folders are deleted
These are the packages.json
(site -> gatsby-theme-B -> gatsby-theme-A)
"dependencies": {
"@mdx-js/mdx": "1.5.1",
"babel-plugin-styled-components": "1.10.6",
"gatsby-plugin-mdx": "1.0.24",
"gatsby-plugin-sharp": "2.3.0",
"gatsby-plugin-styled-components": "3.1.13",
"gatsby-remark-copy-linked-files": "2.1.30",
"gatsby-remark-images": "3.1.31",
"gatsby-source-filesystem": "2.1.37",
"gatsby-transformer-sharp": "2.3.5",
"react-share": "3.0.1",
"remark-slug": "5.1.2",
"styled-components": "4.4.1"
},
"devDependencies": {
"@mdx-js/react": "1.5.1",
"gatsby": "2.17.15",
"react": "16.12.0",
"react-dom": "16.12.0"
},
"dependencies": {
"@mdx-js/react": "^1.5.1",
"deepmerge": "^4.2.2",
"gatsby-image": "^2.2.33",
"gatsby-plugin-feed": "^2.3.21",
"gatsby-plugin-google-tagmanager": "^2.1.17",
"gatsby-plugin-manifest": "2.2.28",
"gatsby-plugin-offline": "3.0.21",
"gatsby-plugin-page-creator": "2.1.30",
"gatsby-plugin-react-helmet": "^3.1.15",
"gatsby-plugin-robots-txt": "1.5.0",
"gatsby-plugin-sitemap": "2.2.21",
"gatsby-theme-A": "*",
"react-cookie-consent": "2.5.0",
"react-helmet": "^5.2.1",
"styled-icons": "8.6.0"
},
"devDependencies": {
"gatsby": "2.17.15",
"react": "16.12.0",
"react-dom": "16.12.0"
},
"dependencies": {
"gatsby": "2.17.15",
"react": "16.12.0",
"react-dom": "16.12.0",
"gatsby-theme-B": "*"
},
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (13 by maintainers)
Commits related to this issue
- Try Gatsby suggested fix for sharp errors on Netlify https://github.com/gatsbyjs/gatsby/issues/19576#issuecomment-557664165 — committed to maecapozzi/blog by maecapozzi 5 years ago
- Drop version of gatsby-plugin-sharp to 2.2.39 until sharp fix is published https://github.com/gatsbyjs/gatsby/issues/19576 — committed to maecapozzi/blog by maecapozzi 5 years ago
Fixed in gatsby-plugin-sharp@2.3.3 sorry for the troubles
I’ll publish a final fix on Monday
@wardpeet, this version of gatsby-plugin-sharp is giving me this error- (sharp:45876): GLib-GObject-WARNING **: 14:29:55.705: cannot register existing type ‘VipsObject’
(sharp:45876): GLib-CRITICAL **: 14:29:55.705: g_once_init_leave: assertion ‘result != 0’ failed
(sharp:45876): GLib-GObject-CRITICAL **: 14:29:55.705: g_type_register_static: assertion ‘parent_type > 0’ failed
(sharp:45876): GLib-CRITICAL **: 14:29:55.705: g_once_init_leave: assertion ‘result != 0’ failed
thanks @ryanditjia for the repo. I’ve got a fix up on https://github.com/gatsbyjs/gatsby/pull/19717
To test it out please use
npm install --save-dev gatsby-plugin-sharp@sharp-cache