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

Gatsby webpack deprecated #2944

Closed
pizzarob opened this issue Nov 17, 2017 · 6 comments
Closed

Gatsby webpack deprecated #2944

pizzarob opened this issue Nov 17, 2017 · 6 comments

Comments

@pizzarob
Copy link

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.

@stephanschubert
Copy link

Also related due to old webpack version:

I had to downgrade babel-loader (yarn add babel-loader@7.1.1 --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

@remoz
Copy link

remoz commented Jan 11, 2018

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.

@KyleAMathews
Copy link
Contributor

Working on it :-)

#2641

Would love any help you could offer!

@alycda
Copy link

alycda commented Mar 1, 2018

Found a workaround from this thread: babel/babel-loader#503 (comment)

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 babel-loader@7.1.1 --dev

clodal added a commit to clodal/clodal.com that referenced this issue Mar 1, 2018
@robdonn
Copy link

robdonn commented Mar 26, 2018

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.

@KyleAMathews
Copy link
Contributor

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!

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

6 participants