stylelint: Error: only one instance of babel-polyfill is allowed

After upgrade stylelint to version 6.4.x my project throw error when buid. Error:

Error: only one instance of babel-polyfill is allowed
    at Object.<anonymous> (/home/.../node_modules/stylelint/node_modules/babel-polyfill/lib/index.js:12:9)
...

My project use stylelint via stylelint-webpack-plugin with webpack@1.x and babel@5.x

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 30 (25 by maintainers)

Commits related to this issue

Most upvoted comments

I think babel-polyfill is the culprit. It should be able, like all polyfill to detect and adjust the definition. This behavior (from a user point of view) is just stupid.

@vn38minhtran did you try this? If so why this simple hook is not included in the polyfill itself?!

@evilebottnawi I use node v4 and I think issue can be solved if we safely require babel-polyfill

if (!global._babelPolyfill) {
   require('babel-polyfill');
}

No rush from my side, I am going to bed and won’t cut a release until tomorrow 😃 Thanks for you hard work!