-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Upgrading to v2 - Cannot find module 'webpack/lib/removeAndDo' #5774
Comments
What does your |
Here's the package file:
Unfortunately, the repo is private and cannot share it. Please let me know what you would like to know as I can provide all the details. |
Try bumping all your |
Hi, Thanks |
Having the same problem. package.json
Terminal:
|
Got same error :( Followed the migration guide, changed all |
Make sure to remove any lock files you have before running install again. |
@KyleAMathews I removed all |
@m-allanson I believe change all
|
I believe Gatsby 2 has removed postcss plugins for now. So the plugin |
Hi, you're right @anantoghosh, In my case I switched to Every gatsby-x plugin point to his "next" version and I checked for each of them if install peer dependencies too; for example the
you can see three packages:
|
@anantoghosh Yeah, I just checked Why are unsupported plugins not listed in the migration documentation? (or supported ones are listed here). But I got another issue, I moved |
@tiendq Did you wrap the components which will use the layout? just renaming won't work, layout is not a special thing in v2 it's just like any other component. |
@anantoghosh Yes, I did. I modified |
I think the solution is buried here:
@m-allanson's suggestion to bump anything that matches the pattern /gatsby-*/ to => "next" fixed this for me. As an example, my v1
I bumped them all to:
removed my |
I'm still getting this error Before adding I tried removing yarn.lock and node_modules with no luck. Looks like the netlify-cms plugin has an update for v2 but it doesn't seem to work. Is it related this issue or should I create a new issue? |
Have the same issue. Here is my package.json
|
I am getting the same error as well. Still getting errors |
@shansmish01 can you share your dependency list from your package.json? |
@shansmith01 after upgrading to
|
I am also getting this error even after bumping the dependencies to {
"name": "gatsby-starter-default",
"description": "Gatsby default starter",
"version": "1.0.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"autoprefixer": "^9.1.1",
"gatsby": "next",
"gatsby-plugin-manifest": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-postcss-sass": "next",
"gatsby-plugin-react-helmet": "next",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-helmet": "^5.2.0"
},
"keywords": [
"gatsby"
],
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write '**/*.js'",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"prettier": "^1.13.7"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
}
} Error log on gatsby develop
success open and validate gatsby-config — 0.155 s
⠁
Your plugins must export known APIs from their gatsby-node.js.
The following exports aren't APIs. Perhaps you made a typo or your plugin is outdated?
See https://www.gatsbyjs.org/docs/node-apis/ for the list of Gatsby Node APIs
- The plugin "gatsby-plugin-postcss-sass@1.0.0-beta.6" is exporting a variable named "modifyWebpackConfig" which isn't an API.
success load plugins — 0.155 s
error Plugin gatsby-plugin-postcss-sass returned an error
Error: Cannot find module 'webpack/lib/removeAndDo'
- v8-compile-cache.js:159 require
[ma1]/[v8-compile-cache]/v8-compile-cache.js:159:20
- ExtractedModule.js:30 Object.<anonymous>
[ma1]/[extract-text-webpack-plugin]/ExtractedModule.js:30:42
- v8-compile-cache.js:178 Module._compile
[ma1]/[v8-compile-cache]/v8-compile-cache.js:178:30
- v8-compile-cache.js:159 require
[ma1]/[v8-compile-cache]/v8-compile-cache.js:159:20
- index.js:7 Object.<anonymous>
[ma1]/[extract-text-webpack-plugin]/index.js:7:23
- v8-compile-cache.js:178 Module._compile
[ma1]/[v8-compile-cache]/v8-compile-cache.js:178:30
- v8-compile-cache.js:159 require
[ma1]/[v8-compile-cache]/v8-compile-cache.js:159:20
- gatsby-node.js:3 Object.<anonymous>
[ma1]/[gatsby-plugin-postcss-sass]/gatsby-node.js:3:33
- v8-compile-cache.js:178 Module._compile
[ma1]/[v8-compile-cache]/v8-compile-cache.js:178:30
error UNHANDLED REJECTION
TypeError: Cannot read property 'filter' of undefined
- api-runner-node.js:274 Promise.mapSeries.catch.then.results
[ma1]/[gatsby]/dist/utils/api-runner-node.js:274:42
- util.js:16 tryCatcher
[ma1]/[bluebird]/js/release/util.js:16:23
- promise.js:512 Promise._settlePromiseFromHandler
[ma1]/[bluebird]/js/release/promise.js:512:31
- promise.js:569 Promise._settlePromise
[ma1]/[bluebird]/js/release/promise.js:569:18
- promise.js:614 Promise._settlePromise0
[ma1]/[bluebird]/js/release/promise.js:614:10
- promise.js:693 Promise._settlePromises
[ma1]/[bluebird]/js/release/promise.js:693:18
- async.js:133 Async._drainQueue
[ma1]/[bluebird]/js/release/async.js:133:16
- async.js:143 Async._drainQueues
[ma1]/[bluebird]/js/release/async.js:143:10
- async.js:17 Immediate.Async.drainQueues
[ma1]/[bluebird]/js/release/async.js:17:14 |
@muhammad-ammar |
Thanks @anantoghosh. Switched to |
If you're using
|
Had the same issue after installing
|
@AntonyMayer , thanks it does work :) |
Sounds like we have a consensus here :) For posterity, looks like there were two issues here and two solutions. Upgrading gatsby plugins to @next
e.g. given {
"dependencies": {
"gatsby-plugin-google-analytics": "^1.0.31",
"gatsby-plugin-canonical-urls": "^1.0.18",
"gatsby-plugin-typography": "^1.7.18",
"gatsby-plugin-catch-links": "^1.0.22",
"gatsby-remark-prismjs": "^2.0.4",
"gatsby-plugin-netlify": "^1.0.21",
"gatsby-source-filesystem": "^1.5.38",
"gatsby-plugin-sass": "^1.0.26",
"gatsby-transformer-remark": "^1.7.44",
"gatsby-plugin-feed": "^1.3.25"
}
} simply change all versions for gatsby- to next and then run {
"dependencies": {
"gatsby-plugin-google-analytics": "next",
"gatsby-plugin-canonical-urls": "next",
"gatsby-plugin-typography": "next",
"gatsby-plugin-catch-links": "next",
"gatsby-remark-prismjs": "next",
"gatsby-plugin-netlify": "next",
"gatsby-source-filesystem": "next",
"gatsby-plugin-sass": "next",
"gatsby-transformer-remark": "next",
"gatsby-plugin-feed": "next"
}
} gatsby-plugin-postcss-sass not applicable for Gatsby v2
Wrap-upClosing for now, but please feel free to re-open if some related issue arises or the solutions here don't work! |
@DSchau,, I just updated from gatsby 2.19.32 to 2.20.21, and suddenly I wasn't able to run I updated all my gatsby-x packages, deleted package-lock and node_modules, then ran My question is, why did I suddenly start needing webpack after just a minor update of Gatsby? |
^ I upgraded from 1.9 (I know) to the latest version and had this problem until I installed |
I followed the v1 to v2 doc
removed the
node-modules
folder and thepackage-lock.json
fileran
npm cache verify
thennpm install
and finallygatsby develop
and now getting the following error:
The text was updated successfully, but these errors were encountered: