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

Unable to Run the project #18

Closed
darshana96 opened this issue Feb 19, 2018 · 4 comments
Closed

Unable to Run the project #18

darshana96 opened this issue Feb 19, 2018 · 4 comments

Comments

@darshana96
Copy link

darshana96 commented Feb 19, 2018

I have update the .bashrc and install the package. I am getting following error.
ERROR in ./src/index.js
Module build failed: ReferenceError: Unknown plugin "add-module-exports" specified in "/Users/webwerks/Documents/Darshana/testProject/Workspace/testProject/testProject/.babelrc" at 0, attempted to resolve relative to "/Users/webwerks/Documents/Darshana/testProject/Workspace/testProject/testProject"

@rnosov
Copy link
Owner

rnosov commented Feb 19, 2018

Are you installing react-reveal via NPM? You should install it like so:

npm install react-reveal --save

and if you need Fade import it like this (from the docs)

import Fade from 'react-reveal/Fade';

It looks like what you're trying to do is to import it from source files which wouldn't work as you need the transpiled output.

@darshana96
Copy link
Author

Yes I am doing the same way. I shall try once again and update you.

@rnosov
Copy link
Owner

rnosov commented Feb 19, 2018

Hmmm, if it's installed via npm then react-reveal errors should generally come from node_modules folder. I see that's not the case in here. Perhaps, you have some problem with your Babel configuration (say add-module-exports is missing) ?

@darshana96
Copy link
Author

Following thing where added for these changes :

  1. .bablerc
    {
    "presets": [
    "react",
    "es2015",
    "stage-2"
    ],
    "plugins": [
    "add-module-exports",
    "transform-runtime"
    ]
    }

  2. webpack.config.js
    loaders:[
    {
    test: /.js$/,
    loader: 'babel-loader',
    exclude: /node_modules/,
    },
    ]

  3. npm install babel-plugin-transform-runtime babel-preset-es2015 babel-preset-stage-2 --save

  4. npm i babel-plugin-add-module-exports babel-preset-es2015 babel-preset-stage-2 --save

Worked for me.
Cheers

@rnosov rnosov closed this as completed Feb 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants