react-player icon indicating copy to clipboard operation
react-player copied to clipboard

Unknown plugin "react-hot-loader/babel"

Open w- opened this issue 9 years ago • 6 comments

  1. yarn add react-player

  2. npm start my project Module build failed: ReferenceError: Unknown plugin "react-hot-loader/babel" specified in "/node_modules/react-player/package.json" at 0

i'm using webpack 3 and don't have react-hot-loader in my project.

I looked at the package.json for react-player and found the babel config for plugins. i deleted react-hot-loader/babel from the plugins array and it seems to be working as expected.

w- avatar Nov 18 '17 04:11 w-

I installed react-player and had the same problem and can confirm that deleting the plugin requirement works.

davidwwu avatar Nov 18 '17 20:11 davidwwu

This is weird. Why would a project that has ReactPlayer installed be looking at the babel config of ReactPlayer itself and trying to load plugins? The babel config is for compiling the library only, and shouldn't be looked at (or cared about) when using a compiled version of ReactPlayer.

cookpete avatar Nov 19 '17 09:11 cookpete

@CookPete Iam also at a loss as to why this is happening.

Do you think it is a misconfigured webpack ?

Are you able to replicate?

w- avatar Nov 19 '17 14:11 w-

I believe this happens when you use babel-loader but do not exlude the node_modules folder as suggested by the babel-loader readme. This will attempt to compile all your imported node modules using babel and in turn, look for the nearest babel config for those files.

If this is not the case, feel free to reopen.

cookpete avatar Dec 01 '17 12:12 cookpete

Wow. talk about noob mistake. thanks very much. As a side effect my builds became much much much much faster. was wondering why things were taking forever.

w- avatar Dec 05 '17 02:12 w-

Thank you @CookPete this solved my problem in an unrelated project.

aftabnaveed avatar Jun 09 '19 23:06 aftabnaveed