Skip to content

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

Closed

Description

@Prestapro

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.

Activity

  1. Johann-S commented on Aug 25, 2017

    @Johann-S
    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

  2. added
    jsJavaScript or TypeScript sources and plugins
    v4v4, the frozen docs on gh-pages
    on Aug 25, 2017
  3. Prestapro commented on Aug 28, 2017

    @Prestapro
    Author

    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
    
  4. iSkore commented on Sep 20, 2017

    @iSkore

    +1

  5. hliberato commented on Sep 26, 2017

    @hliberato

    +1

  6. Johann-S commented on Sep 26, 2017

    @Johann-S
    Member

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

  7. darrensapalo commented on Sep 30, 2017

    @darrensapalo

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

  8. Johann-S commented on Sep 30, 2017

    @Johann-S
    Member

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

  9. bokorir commented on Oct 3, 2017

    @bokorir

    Updating node to the latest version helped me.

  10. mbret commented on Feb 2, 2018

    @mbret

    .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

Metadata

Metadata

Assignees

No one assigned

    Labels

    jsJavaScript or TypeScript sources and pluginsv4v4, the frozen docs on gh-pages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions