Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to load babel plugin react-hot-loader/babel #15

Closed
treshugart opened this issue Aug 1, 2016 · 11 comments
Closed

Error trying to load babel plugin react-hot-loader/babel #15

treshugart opened this issue Aug 1, 2016 · 11 comments

Comments

@treshugart
Copy link

I installed using --save and you have react-hot-loader specified as a dev-dep. Unless I explicitly install it I get:

ERROR in ./~/glamor/lib/index.js
Module build failed: ReferenceError: Unknown plugin "react-hot-loader/babel" specified in "/Users/tshugart/Sites/skatejs/skatejs.github.io/node_modules/glamor/package.json.env.development" at 0, att
empted to resolve relative to "/Users/tshugart/Sites/skatejs/skatejs.github.io/node_modules/glamor"

I could be wrong but it seems that since I'm in "development" it seems your babel env config gets loaded, but since dev deps aren't installed, it can't find the plugin specified in there.

Not sure the best way to fix this without compromising dev ergonomics on your end. You could specify react-hot-loader as a standard dependency so that it's picked up in dev mode for consumers. Thoughts?

@threepointone
Copy link
Owner

good catch. I'll move the react-hot-loader dependency into my demo folder, that should help. gimme half an hour or so. Sorry for the trouble!

@treshugart
Copy link
Author

I just installed it as a dep; easy work around :)

@threepointone
Copy link
Owner

looks like fixing this is going to take longer than I expected, unearthed a couple of other issues. cheers on the workaround, I'll fix this properly soon.

@threepointone
Copy link
Owner

I've rewritten dependencies etc, and published a fresh build. If and when you have the time, do try out 2.2.1 (without react-hot-loader in your deps). Cheers!

@treshugart
Copy link
Author

You're a legend! Thank you. I'll try this tomorrow and close it for now. If I experience issues, I'll reopen.

@anthonyettinger
Copy link

anthonyettinger commented May 4, 2017

Does anyone have a resolution for this issue?

ReferenceError: Unknown plugin "react-hot-loader/babel"

I'm running it with webpack

Module build failed: ReferenceError: Unknown plugin "react-hot-loader/babel" specified in "/Users/example/.babelrc" at 0

Here is my .babelrc

{
  "presets": [
    "es2015",
    "stage-2"
  ],
  "plugins": [
    "react-hot-loader/babel"
  ]
}

I'm guessing its a missing npm module but not sure which one.

@Yoruba
Copy link

Yoruba commented May 11, 2017

I had the same problem after upgrading to version 1.3.1.
After going back to version "react-hot-loader": "^3.0.0-beta.6", the problem is gone with the ReferenceError: Unknown plugin "react-hot-loader/babel".

@SnowFlowers
Copy link

i had the same proble, the node_modules package don't have this file

@codeuniquely
Copy link

have this issue right now

package.json
"react-hot-loader": "^1.3.1",

.babelrc

 plugins: [
     "react-hot-loader/babel",
 ]

Error

ReferenceError: Unknown plugin "react-hot-loader/babel" specified in "c:\\Projects\\Portal\\.babelrc" at 1,
attempted to resolve relative to "c:\\Projects\\Portal"
    at c:\Projects\Portal\node_modules\babel-register\node_modules\babel-core\lib\transformation\file\options\option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (c:\Projects\Portal\node_modules\babel-register\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20)
    at OptionManager.mergeOptions (c:\Projects\Portal\node_modules\babel-register\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36)
    at OptionManager.init (c:\Projects\Portal\node_modules\babel-register\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
    at compile (c:\Projects\Portal\node_modules\babel-register\lib\node.js:103:45)
    at loader (c:\Projects\Portal\node_modules\babel-register\lib\node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (c:\Projects\Portal\node_modules\babel-register\lib\node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)

@gaastonsr
Copy link

Install react-hot-loader with npm install react-hot-loader@next

@jandiralceu
Copy link

thanks @gaastonsr ! its work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants