Support Forums

Gatsby quick start site fails build

My site name: https://clever-almeida-706def.netlify.app
Full build log: https://gist.github.com/jmccaffrey42/e2c8263fa47cf9f752d23beea707fcb1
Site source: https://github.com/jmccaffrey42/pack67-website

Hello all:

I am hitting an issue where my build fails trying to use the static query data (I believe)
9:31:39 AM: error “gatsby-plugin-netlify-cms” threw an error while running the
onCreateWebpackConfig lifecycle:
9:31:39 AM: Module not found: Error: Can’t resolve ‘…/…/public/static/d/1877296825.json’ in
9:31:39 AM:
9:31:39 AM:
9:31:39 AM:
9:31:39 AM: ModuleNotFoundError: Module not found: Error: Can’t resolve ‘…/…/public/stat
ic/d/1877296825.json’ in ‘/opt/build/repo/src/components’

I saw a similar issue locally when using yarn and (presumably) the yarn.lock file that came with gatsby. I noticed if I just did an npm install (not using that lock file, getting updated dependencies) my static query issues went away. Given this, I tried to set my netlify.toml file to use my local version of node (14) and my local version of npm and removed the settings related to yarn. This didn’t have an effect and my build is still failing on the same error.

  publish = "public"
  command = "npm run build"
  functions = "lambda"
  NPM_VERSION = "6.14"

Any ideas what is going on here or how I can troubleshoot it?

hey there, looks very similar to what kaleigh dealt with here:

maybe her fix works for you also?

I ended up doing npm update and pushing that which fixed it. As part of my fixes I also switched it to use NPM instead of yarn FWIW.