Error: only one instance of babel-polyfill is allowed
I just took react-starter-kit to try it out. I did not modify anything in the repository files. I do not yet have good knowledge in node.js and webpack and will provide any additional information needed.
Actions untill error:
- I cloned the repository.
- ran yarn install
- ran yarn start
And then I get this error:
Error: only one instance of babel-polyfill is allowed
at Object.<anonymous> (D:\development\some\node_modules\babel-polyfill\lib\index.js:10:9)
at Module._compile (module.js:571:32)
at Module._extensions..js (module.js:580:10)
at Object.require.extensions.(anonymous function) [as .js] (D:\DEVELOPMENT\some\node_modules\babel-register\lib\node.js:
152:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.6 (D:\development\some\external "babel-polyfill":1:1)
error Command failed with exit code 1.
The same error
Removed 'babel-polyfill' from serverConfig in entry option
entry: {
server: ['./src/server.js']
}
This helped me
Could you give more information about your environment? I just clone the latest and see no error.
- OS : Linux Mint 17.3
$ npm --version
5.3.0
$ node --version
v6.11.0
Removed 'babel-polyfill' from serverConfig in entry option
After try this step also didn't give me an error.
should we remove babel-polyfill from serverConfig, @koistya @frenzzy @langpavel ?
OS: Mac OS Sierra 10.12.15 npm --version 3.10.10 node --version v6.10.1
OS: Windows 10, Version 1703, Build 15063.483 yarn -v yarn install v0.24.6
node -v v7.5.0
I don't see reason why you should remove babel-polyfill. But it should be fine to guarantee all polyfills in vendor chunk and vendor chunk should be loaded only once.
I'm having same issue. Any update on this?
OS: Windows 10, Version 1703, Build 15063.608
npm --version
4.1.2
node --version
v7.7.4
edit: I updated the npm version to 5.4.2 and still not working. By the way, I also have last yarn stable version 1.0.2
I was getting this error and had to remove the babel-runtime package from my package.json dependencies.
The error message is less than helpful, but both packages effectively do the same thing in different ways and cannot be used together.
Here is a short article about it: Babel-polyfill and Babel-runtime Easily Explained
+1
System: Host: *** Kernel: 3.19.0-32-generic x86_64 (64 bit) Desktop: MATE 1.12.0 Distro: Linux Mint 17.3 Rosa
@VimCommando There is no babel-runtime in package.json for me.
@driglou thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion.
NOTE: The main branch has been updated with React Starter Kit v2, using JAM-style architecture.