Gatsby: Gatsby webpack deprecated

Created on 17 Nov 2017  Â·  6Comments  Â·  Source: gatsbyjs/gatsby

We are running into many issues building. We have a mono repo and my guess is that our version of webpack/plugins conflicts with the many deprecated webpack plugins gatsby uses. It would be great to update webpack and all plugins.

Most helpful comment

Also related due to old webpack version:

I had to downgrade babel-loader (yarn add [email protected] --dev) to get gatsby develop working — otherwise this error pops up:

error There was an error compiling the html.js component for the development server.

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND


  Error: Module build failed: TypeError: fileSystem.statSync is not a function

  - exists.js:7 module.exports

All 6 comments

Also related due to old webpack version:

I had to downgrade babel-loader (yarn add [email protected] --dev) to get gatsby develop working — otherwise this error pops up:

error There was an error compiling the html.js component for the development server.

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND


  Error: Module build failed: TypeError: fileSystem.statSync is not a function

  - exists.js:7 module.exports

Our team has also encountered this problem with our mono repo (with the same console error that jazen encountered). It would be extremely valuable long term if the Gatsby team considered upgrading their webpack dependency, since we've found that the older version clashes with our other projects that run on newer versions.

Working on it :-)

https://github.com/gatsbyjs/gatsby/issues/2641

Would love any help you could offer!

Found a workaround from this thread: https://github.com/babel/babel-loader/issues/503#issuecomment-324269100

Steps to reproduce:

  1. gatsby new gatsby-starter https://github.com/fabien0102/gatsby-starter
  2. cd gatsby-starter
  3. npm start or npm run build

Expected result: gatsby starts a server at localhost:8000 or build successfully
Actual Result: Error: Module build failed: TypeError: fileSystem.statSync is not a function

yarn info version:
webpack: 4.0.1
babel-core: 6.26.0
babel-loader: 7.1.3

current workaround: (thanks to @JackyTung) yarn add [email protected] --dev

For anyone still having problems with this while using Yarn Workspaces, use the new nohoist feature introduced in 1.4.2.
https://yarnpkg.com/blog/2018/02/15/nohoist/

_/package.json_

...
"private" true,
"workspaces": {
  "packages": [
    "documentation",
    "packages/*"
  ]
},
...

_/documentation/package.json_

...
"private" true,
"workspaces": {
  "nohoist": [
    "gatsby"
  ]
},
...

This will prevent Gatsby and it's dependencies (like the offending webpack) from being hoisted to the root.

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benstr picture benstr  Â·  3Comments

theduke picture theduke  Â·  3Comments

jimfilippou picture jimfilippou  Â·  3Comments

andykais picture andykais  Â·  3Comments

magicly picture magicly  Â·  3Comments