gatsby: [gatsby-plugin-netlify-cms]: Cannot find module 'uglifyjs-webpack-plugin'
Description
I tried rebuilding my project but couldn’t. gatsby develop and gatsby build give the same error. If I add uglifyjs-webpack-plugin the project builds without errors. I didn’t change any code since my last successful build, nor could I find any recent commits referring to this module.
Expected result
Build
Actual result
Buildn’t
Environment
System:
OS: macOS 10.14.1
CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.2.0 - ~/.nvm/versions/node/v11.2.0/bin/node
npm: 6.4.1 - ~/.nvm/versions/node/v11.2.0/bin/npm
Browsers:
Chrome: 70.0.3538.110
Firefox: 63.0.3
Safari: 12.0.1
npmPackages:
gatsby: ^2.0.53 => 2.0.53
gatsby-image: ^2.0.20 => 2.0.20
gatsby-plugin-canonical-urls: ^2.0.7 => 2.0.7
gatsby-plugin-create-client-paths: ^2.0.2 => 2.0.2
gatsby-plugin-feed: ^2.0.9 => 2.0.9
gatsby-plugin-gtag: ^1.0.4 => 1.0.4
gatsby-plugin-manifest: ^2.0.9 => 2.0.9
gatsby-plugin-netlify: ^2.0.5 => 2.0.5
gatsby-plugin-netlify-cache: ^1.0.0 => 1.0.0
gatsby-plugin-netlify-cms: ^3.0.7 => 3.0.7
gatsby-plugin-no-sourcemaps: ^2.0.1 => 2.0.1
gatsby-plugin-offline: ^2.0.16 => 2.0.16
gatsby-plugin-react-helmet: ^3.0.2 => 3.0.2
gatsby-plugin-robots-txt: ^1.3.0 => 1.3.0
gatsby-plugin-sharp: ^2.0.12 => 2.0.12
gatsby-plugin-sitemap: ^2.0.2 => 2.0.2
gatsby-plugin-styled-components: ^3.0.3 => 3.0.3
gatsby-remark-images: ^2.0.6 => 2.0.6
gatsby-source-filesystem: ^2.0.8 => 2.0.8
gatsby-transformer-remark: ^2.1.12 => 2.1.12
gatsby-transformer-sharp: ^2.1.8 => 2.1.8
npmGlobalPackages:
gatsby-cli: 2.4.5
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 16 (12 by maintainers)
Commits related to this issue
- fix(gatsby-plugin-netlify-cms): Add uglifyjs-webpack-plugin to dependencies Closes #10067 — committed to gatsbyjs/gatsby by krismorf 6 years ago
- fix(gatsby-plugin-netlify-cms): fix uglify webpack plugin check (#10150) Closes #10067. Replaces #10149. Webpack started using terser instead of uglify, which broke our plugin's check for the ugl... — committed to gatsbyjs/gatsby by erquhart 6 years ago
- fix(gatsby-plugin-netlify-cms): fix uglify webpack plugin check (#10150) Closes #10067. Replaces #10149. Webpack started using terser instead of uglify, which broke our plugin's check for the ugl... — committed to gpetrioli/gatsby by erquhart 6 years ago
Ah, figured it out - the problem is that Webpack 4.26.0 moved from
uglifyjs-webpack-plugintoterser-webpack-plugin. We need to check for instance of that (for now) instead.Encountered the same error today when deploying the site to Netlify.
gatsby developandgatsby buildcommands complete successfully locally. Deploy failed though. Versions:gatsby 2.0.19netlify-cms 2.2.0Worked after listing
uglifyjs-webpack-pluginas a dependency.I reproduced this.
@agustinmulet
webpack.IgnorePlugin, doesn’t ignore plugins 😃 it’s plugin to ignore imports in the code