I'm getting error when running gatsby build for a second time (with cache present).
It happens only when I query image in 404 page.
404.js page content with content from components/image.js.yarn buildEverything works as expected.
Error: ENOENT: no such file or directory, open '/sandbox/public/page-data/404.html/page-data.json'
Codesandbox
Can you try upgrading to the latest version of gatsby? (>2.10.0) it seems like it fixed the issue for me on codesandbox. We have done a few fixes.
https://codesandbox.io/s/gatsby-starter-default-45604?fontsize=14
@wardpeet Thanks for the response. It still happens after upgrading, in my local builds and on codesandbox when you run yarn build second time in a row.
ok awesome! thanks for letting me know I'll have a look
Hey - Just reporting the same exact issue. To prevent it, I need to remove the .cache directory (no need to remove the public one) which makes the build much slower of course.
gatsby info
bash
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.6.0 - ~/.nvm/versions/node/v11.6.0/bin/node
Yarn: 1.12.3 - ~/.nvm/versions/node/v11.6.0/bin/yarn
npm: 6.5.0-next.0 - ~/.nvm/versions/node/v11.6.0/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 75.0.3770.100
Firefox: 67.0.4
Safari: 12.1.1
npmPackages:
gatsby: ^2.11.7 => 2.11.7
gatsby-image: ^2.2.3 => 2.2.3
gatsby-link: ^2.2.0 => 2.2.0
gatsby-plugin-gtag: ^1.0.11 => 1.0.11
gatsby-plugin-mailchimp:
https://github.com/benjaminhoffman/gatsby-plugin-mailchimp.git#gatsby-v2 =>
3.3.0
gatsby-plugin-manifest: ^2.2.0 => 2.2.0
gatsby-plugin-offline: ^2.2.0 => 2.2.0
gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0
gatsby-plugin-react-helmet-canonical-urls: ^1.2.0 => 1.2.0
gatsby-plugin-remove-serviceworker: ^1.0.0 => 1.0.0
gatsby-plugin-remove-trailing-slashes: ^2.1.0 => 2.1.0
gatsby-plugin-sass: ^2.1.0 => 2.1.0
gatsby-plugin-sharp: ^2.2.1 => 2.2.1
gatsby-plugin-sitemap: ^2.2.1 => 2.2.1
gatsby-plugin-webpack-bundle-analyzer: ^1.0.5 => 1.0.5
gatsby-source-filesystem: ^2.1.1 => 2.1.1
gatsby-source-prismic: ^2.2.0 => 2.2.0
gatsby-transformer-sharp: ^2.2.0 => 2.2.0
gatsby-transformer-sqip: 2.1.3 => 2.1.3
I'm also having the same issue with the latest version of gatsby 2.13.27.
Im also having the same issue. I cannot even make a simple page level query from my Index.js. Im getting a "TypeError: Object(...) is not a function" error. this is on gatsby.js version 2.13.42
Can confirm this is occurring on 2.13.50
Fixed in [email protected]
The same on 2.15.14
same bug on gatsby: 2.18.5