Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

Cannot remove "babel-plugin-transform-es2015-modules-commonjs" from the plugin list #9

Closed
scottlaplante opened this issue Aug 5, 2016 · 4 comments

Comments

@scottlaplante
Copy link

Two items that may help narrow down the issue:

  1. I previously had older versions of both node and npm on my system.
  2. During the npm dependency resolution stage, I see this warning:
npm WARN karma-webpack@1.7.0 requires a peer of webpack@^1.4.0 but none was installed.

I do see the webpack creating some bundles:

Hash: b068372baa672e06b4d7
Version: webpack 2.1.0-beta.20
Time: 1907ms
                                      Asset       Size  Chunks             Chunk Names
     bundle.app.f664776ed4d591679617.js.map    2.59 kB    1, 2  [emitted]  app
      bundle.vendor.037e898b2f23ec84c376.js  138 bytes    0, 2  [emitted]  vendor
    bundle.manifest.9eb8de37e396657e9121.js    1.46 kB       2  [emitted]  manifest
     styles.vendor.037e898b2f23ec84c376.css    5.13 kB    0, 2  [emitted]  vendor
  bundle.vendor.037e898b2f23ec84c376.js.map  663 bytes    0, 2  [emitted]  vendor
 styles.vendor.037e898b2f23ec84c376.css.map  115 bytes    0, 2  [emitted]  vendor
         bundle.app.f664776ed4d591679617.js    2.22 kB    1, 2  [emitted]  app
bundle.manifest.9eb8de37e396657e9121.js.map    13.6 kB       2  [emitted]  manifest
                                 index.html     3.5 kB          [emitted]  
                                      sw.js    5.94 kB          [emitted]  
                 appcache/manifest.appcache  228 bytes          [emitted]  
                     appcache/manifest.html   58 bytes          [emitted]  
   [2] multi vendor 28 bytes {0} [built]
    + 5 hidden modules

And directly after that output I receive my first error:

ERROR in ./bootstrap.js
Module build failed: Error: Cannot remove "babel-plugin-transform-es2015-modules-commonjs" from the plugin list.
    at Object.<anonymous> (/Users/slaplante/workspace/frontendmasters/es6-todomvc/node_modules/babel-preset-es2015-webpack/index.js:35:11)

Many (but not all) of the chunks fail:

chunk    {0} vendor, styles.vendor.css (vendor) 69 bytes [entry]
    [0] ./~/todomvc-app-css/index.css 41 bytes {0} [built]
    [2] multi vendor 28 bytes {0}
chunk    {1} app (app) 1.73 kB [entry]
    [1] ./src/bootstrap.js 1.73 kB {1} [built] [failed] [1 error]
chunk    {2} src/view.js (src/view.js) 1.73 kB [entry] [rendered]
   [16] ./src/view.js 1.73 kB {2} [built] [failed] [1 error]
chunk    {3} src/todo.js (src/todo.js) 1.73 kB [entry] [rendered]
   [15] ./src/todo.js 1.73 kB {3} [built] [failed] [1 error]

All of the errors that are reported are the same "Cannot remove...from plugin list" on the same plugin.

Based on gajus/babel-preset-es2015-webpack#10
I tried running

npm uninstall --save-dev babel-preset-es2015

both before and after changing back to the master branch, but the same errors are reported.

N.B. the setup:fem script is found in the master branch but the script changes you to another branch; ipso facto that script cannot be run twice without switching back to master.

Finally, npm itself reports this to me:

npm ERR! Failed at the @ build script 'webpack --env.prod -p'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack --env.prod -p

as well as

npm ERR! Tell the author that this fails on your system:
npm ERR!     npm-run-all --parallel lint build test

as well as

npm ERR! Tell the author that this fails on your system:
npm ERR!     git checkout FEM/07.1-deploy-surge && npm install && npm run validate && rimraf dist coverage && git checkout FEM/00-original-project
@kentcdodds
Copy link
Owner

Yeah, so babel pushed a breaking change last night that I think is responsible for this. I've been traveling all day and haven't had a chance to fix it. I'm working on it now. Thank you so much for trying things out and reporting this issue!

@kentcdodds
Copy link
Owner

Alrighty, I think I've fixed it. Could you try a fresh clone? Thanks again for reporting this issue!

@scottlaplante
Copy link
Author

All I had to do was

git checkout master
git pull
git branch -D FEM/07.1-deploy-surge

and then re-run the setup and start npm commands. Looks gorgeous now. Thanks!

@kentcdodds
Copy link
Owner

Awesome! See you next week!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants