Skip to content

Webpack 2/bootstrap 4 beta build fails on missing plugin #23620

Closed

Description

@peterdutton

Hi,

I had an issue with building Bootstrap with Webpack where, after following the Getting Started guide, I was seeing the following error:

ERROR in ./node_modules/bootstrap/dist/js/bootstrap.js Module build failed: ReferenceError: Unknown plugin "transform-es2015-modules-strip" specified in "/home/laptop/webpack-test/node_modules/bootstrap/.babelrc" at 0, attempted to resolve relative to "/home/laptop/webpack-test/node_modules/bootstrap"

However this package does seem to be specified as a dev dependency in the Bootstrap package.json.

To resolve it I had to manually install the plugin in my project, e.g:

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

Hopefully this will save others some time, or someone more proficient with npm than me will be able to see what the issue is.

Thanks!

Activity

  1. peternewnham commented on Aug 22, 2017

    @peternewnham

    Is the babel loader in your webpack config excluding node_modules? Bootstrap publishes it's .babelrc file so I suspect babel loader is parsing all of your dependencies and using any .babelrc files it comes across.

  2. peterdutton commented on Aug 22, 2017

    @peterdutton
    Author

    I wasn't excluding node_modules.
    I removed the babel-plugin-transform-es2015-modules-strip package from my project, retried with the exclusion in place and everything works as it should.
    Thanks for your help!
    Is this a convention that folks would normally know to follow, or is it worth adding to the docs?

  3. Johann-S commented on Aug 22, 2017

    @Johann-S
    Member

    It's a best practice to not include node_modules in your babel loader instead of you have the need to build your dependencies

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions