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

Module build failed: ReferenceError: Unknown plugin "add-module-exports" #569

Closed
montanaflynn opened this issue Nov 29, 2017 · 12 comments
Closed

Comments

@montanaflynn
Copy link

Summary:

After installing with npm install react-modal --save running my app with webpack fails.

Steps to reproduce:

  1. npm install react-modal --save
  2. add import Modal from 'react-modal';
  3. run npm run dev

Get this error:

ERROR in ./node_modules/react-modal/lib/index.js
Module build failed: ReferenceError: Unknown plugin "add-module-exports" specified in "/dev/app/node_modules/react-modal/.babelrc" at 0, attempted to resolve relative to "/dev/app/node_modules/react-modal"
    at /dev/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (/dev/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/dev/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/dev/app/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/dev/app/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/dev/app/node_modules/babel-core/lib/transformation/file/index.js:135:24)
    at Pipeline.transform (/dev/app/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/dev/app/node_modules/babel-loader/lib/index.js:50:20)
    at /dev/app/node_modules/babel-loader/lib/fs-cache.js:118:18
 @ ./src/pages/url-form.js 29:18-40
 @ ./src/components/app.js
 @ ./src/containers/app.js
 @ ./src/index.js
 @ multi (webpack)-dev-server/client?http://0.0.0.0:3000 ./src/index.js
@diasbruno
Copy link
Collaborator

Hi @montanaflynn, I've tried to reproduce this issue on a new project, but the error didn't show up.
Using react@16+, react-dom@16+ and [email protected].

@montanaflynn
Copy link
Author

@diasbruno what info could I give to help? I don't have a .babelrc file at the root of my project.

@diasbruno
Copy link
Collaborator

What is the command for npm run dev?

@montanaflynn
Copy link
Author

webpack-dev-server --progress

@diasbruno
Copy link
Collaborator

How is the loader configured?

@diasbruno
Copy link
Collaborator

Maybe we need to include .babelrc on .npmignore since the module is already built.

diasbruno added a commit that referenced this issue Nov 29, 2017
@diasbruno
Copy link
Collaborator

Can you try installing using react-modal@ignoring-dot-babelrc? Hope this will also fix #450.

@HipsterZipster
Copy link

.babelrc shouldn't be included in the distribution since babel runtime will pick it up in some scenarios and try to load it

@HipsterZipster
Copy link

@diasbruno Can you merge in the ignoring-dot-babelrc branch? Let's push it

@diasbruno
Copy link
Collaborator

@HipsterZipster Sure!

@diasbruno
Copy link
Collaborator

Released v3.1.7.

@lvl99
Copy link

lvl99 commented Jan 28, 2018

I have the same issue, however the package.json for my framework has a "babel.env.development" object which is getting loaded when I run env as development on another project which includes the framework files. Anyway to get the framework package settings ignored? Or is there a better way around this?

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

No branches or pull requests

4 participants