react-starter-kit icon indicating copy to clipboard operation
react-starter-kit copied to clipboard

Error: only one instance of babel-polyfill is allowed

Open driglou opened this issue 9 years ago • 9 comments

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:

  1. I cloned the repository.
  2. ran yarn install
  3. 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.

driglou avatar Jul 16 '17 15:07 driglou

The same error Removed 'babel-polyfill' from serverConfig in entry option entry: { server: ['./src/server.js'] } This helped me

AlSUit avatar Jul 18 '17 22:07 AlSUit

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 ?

ucay avatar Jul 19 '17 00:07 ucay

OS: Mac OS Sierra 10.12.15 npm --version 3.10.10 node --version v6.10.1

AlSUit avatar Jul 19 '17 04:07 AlSUit

OS: Windows 10, Version 1703, Build 15063.483 yarn -v yarn install v0.24.6

node -v v7.5.0

driglou avatar Jul 19 '17 10:07 driglou

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.

langpavel avatar Jul 20 '17 01:07 langpavel

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

Jotakuun avatar Sep 17 '17 12:09 Jotakuun

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

VimCommando avatar Sep 26 '17 01:09 VimCommando

+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.

mort3za avatar Oct 16 '17 16:10 mort3za

@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.

ulani avatar May 27 '21 20:05 ulani