aleksei0807 / react-images-uploader

React.js component for uploading images to the server
MIT License
177 stars 67 forks source link

Babel-pollyfill instance problem #17

Open plvz opened 7 years ago

plvz commented 7 years ago

Hello for one project I want to use react-image-uploader so I installed it. then I added the import in my Home.js like that:

import React, { PropTypes } from 'react'; import ImageUploader from 'react-images-uploader'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Home.scss'; .....

Home.propTypes = { news: PropTypes.arrayOf(PropTypes.shape({ title: PropTypes.string.isRequired, link: PropTypes.string.isRequired, contentSnippet: PropTypes.string, })).isRequired, };

export default withStyles(Home, s);

Then when I run the server I got an error :


/home/pellevoizin/Documents/stargazer/node_modules/react-images-uploader/node_modules/babel-polyfill/lib/index.js:10`
  throw new Error("only one instance of babel-polyfill is allowed");
        ^
Error: only one instance of babel-polyfill is allowed at Object.<anonymous> (/home/pellevoizin/Documents/stargazer/node_modules/react-images-uploader/node_modules/babel-polyfill/lib/index.js:10:9)
    at Module._compile (module.js:612:30)
    at Module._extensions..js (module.js:623:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/pellevoizin/Documents/stargazer
/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/pellevoizin/Documents/stargazer/node_modules/react-images-uploader/lib/index.js:68:1)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)

If I remove the import ImageUploader from 'react-images-uploader'; I haven't error, someone could help me ?

Ulminator commented 6 years ago

Has this been resolved at all? I'm having the same issue

kirillDanshin commented 6 years ago

hi. I think you should double-check your webpack/babel config. this bug may occur when you did something wrong with webpack or babel configs. please check that you did it right and ping me if you need further help.