Everything is fine until it gets to the Generating static HTML for pages part. It fails after a few seconds with the following error message:
error Generating static HTML for pages failed
Error:
Error: Module not found: Error: Cannot resolve 'file' or 'directory' ../public/chunk-manifest.json in /home/coder/Developer/portfolio/.cache
resolve file
/home/coder/Developer/portfolio/public/chunk-manifest.json doesn't exist
/home/coder/Developer/portfolio/public/chunk-manifest.json.js doesn't exist
/home/coder/Developer/portfolio/public/chunk-manifest.json.jsx doesn't exist
resolve directory
/home/coder/Developer/portfolio/public/chunk-manifest.json doesn't exist (directory default file)
/home/coder/Developer/portfolio/public/chunk-manifest.json/package.json doesn't exist (directory description file)
[/home/coder/Developer/portfolio/public/chunk-manifest.json]
[/home/coder/Developer/portfolio/public/chunk-manifest.json.js]
[/home/coder/Developer/portfolio/public/chunk-manifest.json.jsx]
@ ./.cache/static-entry.js 143:22-67
I tried running gatsby build in a clean gatsby directory, and it works without a hitch. Any idea what could be causing this issue for this particular project?
Gatsby-config.js
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-sass`
],
};
Relevant package.json
"dependencies": {
"animate.css": "^3.5.2",
"gatsby": "^1.6.5",
"gatsby-link": "^1.6.5",
"gatsby-plugin-react-helmet": "^1.0.1",
"gatsby-plugin-sass": "^1.0.1",
"react-addons-css-transition-group": "^15.6.0",
"react-bootstrap": "^0.31.2",
"semantic-ui-css": "^2.2.12",
"semantic-ui-react": "^0.71.4"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"main": "n/a",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "rm -rf public && gatsby build --prefix-paths && gh-pages -d public"
},
"devDependencies": {
"eslint": "^4.4.1",
"eslint-plugin-react": "^7.2.0",
"prettier": "^1.5.2"
}
Hi, do you have canned resolve the problem ?? I have same issue
@rshah03 Same issue here. Did you find a way around?
If someone could build and share a site that reproduces this error that'd be great.
Same error here. Not sure on the process to build and share my site, here's a link to it on github, pre-build: https://github.com/H3yfinn/finbarmaunsell.com
And here's the error:
error Building static HTML for pages failed
See our docs page on debugging HTML builds for help https://goo.gl/yL9lND
Error: Module not found: Error: Cannot resolve 'file' or 'directory' ../public /chunk-manifest.json in /home/h3yfinn/finbarmaunsell.com/.cache
resolve file
/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json doesn't exist
/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json.jsx doesn't exis t
/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json.js doesn't exist resolve directory
/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json doesn't exist (d irectory default file)
/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json/package.json doe sn't exist (directory description file)
[/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json]
[/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json.jsx]
[/home/h3yfinn/finbarmaunsell.com/public/chunk-manifest.json.js]
@ ./.cache/static-entry.js 159:22-67
I can confirm that we get this same error when using import or React Loadable for code splitting:
https://github.com/reactjs/reactjs.org/blob/master/content/docs/code-splitting.md
Yeah, react-loadable won't work with Gatsby until v2 is out since we're still on webpack v1 which doesn't support the async import (used under the hood in react-loadable). V2 is coming along so the more helpers the faster it'll be out! https://github.com/gatsbyjs/gatsby/projects/2
Gatsby v2 beta already works pretty well with react-loadable, I created an example repo including Lighthouse audits: https://github.com/fabe/gatsby-react-loadable
Since this is working now in v2, closing!
Most helpful comment
Gatsby v2 beta already works pretty well with
react-loadable, I created an example repo including Lighthouse audits: https://github.com/fabe/gatsby-react-loadable