Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rburgst/gatsby-rebuilding-problem
demonstrates a problem with gatsby rebuilding the pages all over
https://github.com/rburgst/gatsby-rebuilding-problem
Last synced: 2 days ago
JSON representation
demonstrates a problem with gatsby rebuilding the pages all over
- Host: GitHub
- URL: https://github.com/rburgst/gatsby-rebuilding-problem
- Owner: rburgst
- License: mit
- Created: 2020-05-11T10:55:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T12:03:51.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T17:53:07.625Z (about 2 months ago)
- Language: JavaScript
- Size: 903 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sample Gatsby wpgraphql demonstrating rebuilding issues
this is a sample repository to demonstrate a problem in gatsby when
using `yarn develop` (i.e. `gatsby develop`).As soon as an image resolver is added, the pages get regenerated
many many times.The image resolver is more or less the code documented at
https://www.gatsbyjs.org/docs/schema-customization/#feeding-remote-images-into-gatsby-image
To reproduce do the following
```bash
yarn install
yarn develop
```now watch the output.
### Expected
the output
```
create POSTS ======== =
```should only appear once.
### Actual
The pages are being regenerated 4 times.
It appears that the pages are being regenerated for every single image.
### Solution
A workaround is to use the `sourceNodes` lifecycle and load all images there.
Thanks a lot to [@sanderploegsma](https://github.com/sanderploegsma) for providing the correct solution!More info can be found here:
- https://github.com/gatsbyjs/gatsby/issues/20083
- https://github.com/gatsbyjs/gatsby/issues/15906
- https://github.com/gatsbyjs/gatsby/issues/20083#issuecomment-626646103 (working workaround)