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

ReferenceError: Unknown plugin "transform-es2015-modules-strip [FIX] #23662

Closed
Prestapro opened this issue Aug 24, 2017 · 9 comments
Closed

ReferenceError: Unknown plugin "transform-es2015-modules-strip [FIX] #23662

Prestapro opened this issue Aug 24, 2017 · 9 comments
Labels

Comments

@Prestapro
Copy link

Prestapro commented Aug 24, 2017

Hello,

I understand that you are a large team, but I do not have time to write a detailed report:

In bootstrap beta 4 there is an error, I found the problem and fixed it in my code.

You can see here:
https://stackoverflow.com/questions/45660672/webpack-fails-to-load-bootstrap-v4-0-0-beta/45872157#45872157

Error:

ERROR in ./node_modules/bootstrap/dist/js/bootstrap.min.js
Module build failed: ReferenceError: Unknown plugin "transform-es2015-modules-strip" specified in "/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/bootstrap/.babelrc" at 0, attempted to resolve relative to "/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/bootstrap"
    at /Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-loader/lib/index.js:50:20)
    at Object.module.exports (/Applications/MAMP/htdocs/1.7/singlewave/themes/singlewave/_dev/node_modules/babel-loader/lib/index.js:175:20)
 @ ./js/theme.js 5:0-42
 @ multi webpack/hot/dev-server webpack-hot-middleware/client ./js/theme.js

npm install babel-plugin-transform-es2015-modules-strip

And them install:

babel-preset-es2015
babel-preset-stage-2

I hope you will be wise and add this fix.

With respect,
Alexander.

@Johann-S
Copy link
Member

Sorry but it's not an issue in our end because it seems you're trying to build Bootstrap instead of just using our dist files.
Excluding the node_modules from your Babel configuration should do the job

@Prestapro
Copy link
Author

Prestapro commented Aug 28, 2017

Hello,
Johann-S

Webpack config:

{
  test: /\.js/,
  loader: 'babel-loader',
  options: {
    ignore: '/node_modules/'
  }
},

When I'm excluding folder node_modules I get this error:

ERROR in ./~/bootstrap/dist/js/bootstrap.min.js
Module build failed: ReferenceError: [BABEL] /Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/bootstrap/dist/js/bootstrap.min.js: Unknown option: /Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/bootstrap/.babelrc.presets
    at Logger.error (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/logger.js:58:11)
    at OptionManager.mergeOptions (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:29)
    at OptionManager.addConfig (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10)
    at OptionManager.findConfigs (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35)
    at OptionManager.init (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12)
    at File.initOptions (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/index.js:147:75)
    at new File (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/file/index.js:137:22)
    at Pipeline.transform (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at transpile (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/index.js:12:22)
    at Object.module.exports (/Applications/MAMP/htdocs/1.7/singlewave/themes/classic/_dev/node_modules/babel-loader/index.js:71:12)
 @ ./js/theme.js 31:0-42
 @ multi ./js/theme.js ./css/theme.scss

@iSkore
Copy link

iSkore commented Sep 20, 2017

+1

1 similar comment
@hliberato
Copy link

+1

@Johann-S
Copy link
Member

@Prestapro is it possible for you to remove the .babelrc in node_modules/bootstrap/ and give it a new try please ?

@darrensapalo
Copy link

@Johann-S Deleting the .babelrc file fixed it for me. Thank you.

@Johann-S
Copy link
Member

Johann-S commented Sep 30, 2017

That's because you shouldn't try to build Bootstrap on your own project use : ignore: 'node_modules/**'

@bokorir
Copy link

bokorir commented Oct 3, 2017

Updating node to the latest version helped me.

@mbret
Copy link

mbret commented Feb 2, 2018

.babelrc should not be present on the bootstrap package. When building your project with babel, it will lookup by default on all babelrc. See lookup behavior https://babeljs.io/docs/usage/babelrc/ When building a npm package (eg: bootstrap) you should ignore everything but /dist files. Also until they fix it we could still use "babelrc": false, but it does not seems to work for all of my projects.

edit: it's fixed sorry (my bad)

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

No branches or pull requests

7 participants