question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Unknown plugin "add-module-exports"

See original GitHub issue

I use example in the README, but get a error.

ERROR in ./~/react-dropzone/dist/index.js
Module build failed: ReferenceError: Unknown plugin "add-module-exports" specified in "/Users/admin/Coding_Project/online-presentation/node_modules/react-dropzone/.babelrc" at 0, attempted to resolve relative to "/Users/admin/Coding_Project/online-presentation/node_modules/react-dropzone"
    at /Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (/Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (/Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/file/index.js:139:24)
    at Pipeline.transform (/Users/admin/Coding_Project/online-presentation/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
    at transpile (/Users/admin/Coding_Project/online-presentation/node_modules/babel-loader/lib/index.js:46:20)
    at Object.module.exports (/Users/admin/Coding_Project/online-presentation/node_modules/babel-loader/lib/index.js:134:16)
 @ ./scripts/reducers/DropzoneDemo.js 12:21-46
 @ ./scripts/index.js

My file is like this: DropzoneDemo.js

import React from 'react';
import Dropzone from 'react-dropzone';

var DropzoneDemo = React.createClass({
    onDrop: function (files) {
      console.log('Received files: ', files);
    },

    render: function () {
      return (
          <div>
            <Dropzone onDrop={this.onDrop}>
              <div>Try dropping some files here, or click to select files to upload.</div>
            </Dropzone>
          </div>
      );
    }
});

export default DropzoneDemo;

index.js

import React from 'react';
import ReactDOM from 'react-dom';

import DropzoneDemo from './reducers/DropzoneDemo.js';

ReactDOM.render(
  <DropzoneDemo />,
  document.getElementById('uploadFile')
);

browser: newest Chrome Operating System: macOS Sierra 10.12.3 react-dropzone version: ^3.12.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:14

github_iconTop GitHub Comments

14reactions
elliotrockcommented, Apr 24, 2017

The solution as an example:

Add: exclude: /node_modules/

module: {
        loaders: [
            {
                test: /\.js[x]?$/,
                loader: 'babel-loader',
                exclude: /node_modules/
            },
            {
                test: /\.css$/,
                loader: 'css-loader'
            }
        ],   
    }
3reactions
wbeckercommented, Mar 30, 2017

could you solve this @jasonzhouu ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

parcel bundler - Unknown plugin "add-module-exports"
It seems like parcel-bundler uses babel v6 so my question is , how can I ignore node_modules and get parcel to bundle without...
Read more >
babel-plugin-add-module-exports - npm
js. This plugin follows the babel@5 behavior - add the module. exports if only the export default declaration exists.
Read more >
Unknown plugin 'add-module-exports' - Bountysource
Hello, I am getting an error when trying to use this. ERROR in ./~/react-text-truncate/lib/index.js Module build failed: ReferenceError: ...
Read more >
babel/plugin-transform-typescript
This plugin adds support for the types syntax used by the TypeScript ... result in an error: "Namespaces exporting non-const are not supported...
Read more >
rollup.js
A config file is an ES module that exports a default object with the desired options: export default { input: 'src/main.js', output: {...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found