Skip to content
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

Production Build Failed: build not generating chunk-manifest.json #1850

Closed
rshah03 opened this issue Aug 18, 2017 · 8 comments
Closed

Production Build Failed: build not generating chunk-manifest.json #1850

rshah03 opened this issue Aug 18, 2017 · 8 comments

Comments

@rshah03
Copy link

rshah03 commented Aug 18, 2017

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"
  }
@canoqb10
Copy link

Hi, do you have canned resolve the problem ?? I have same issue

@neilyoung
Copy link

@rshah03 Same issue here. Did you find a way around?

@KyleAMathews
Copy link
Contributor

If someone could build and share a site that reproduces this error that'd be great.

@H3yfinn
Copy link

H3yfinn commented Jan 7, 2018

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

@vanbroup
Copy link

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

@KyleAMathews
Copy link
Contributor

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

@fabe
Copy link
Contributor

fabe commented Jun 19, 2018

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

@KyleAMathews
Copy link
Contributor

Since this is working now in v2, closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants