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

Published NPM package executes dev dependencies (HMR) #264

Closed
jaredhughes opened this issue Jun 21, 2016 · 0 comments
Closed

Published NPM package executes dev dependencies (HMR) #264

jaredhughes opened this issue Jun 21, 2016 · 0 comments

Comments

@jaredhughes
Copy link

When installed via NPM and compiled and deployed as part of a larger application, this package includes references to Hot Module Replacement, throwing the follow error in a production environment:

Uncaught Error: locals[0] does not appear to be a module object with Hot Module replacement API enabled. You should disable react-transform-hmr in production by using env section in Babel configuration. See the example in README: https://github.com/gaearon/react-transform-hmr

While it appears that the .babelrc file correctly configures this transform to be executed only in development, it's still somehow slipping through – likely within build scripts execute during publication to NPM.

To further test the issue, you can install v0.14.0 within any React project and execute grep hmr -rl node_modules/ – this package will be the only one that includes references to HMR.

I'm going to continue to debug on my end and will submit a PR if I find a solution. In the meantime, I wanted to raise awareness of the issue in case anyone can track it down more quickly.

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

1 participant