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

locals[0] does not appear to be a `module` object with Hot Module Replacement API enabled.

Open beinginorbit opened this issue 10 years ago • 13 comments

I'm getting the following error after enabling hot reloading (iOS Simulator and Device):

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

proxyReactComponents
    index.ios.bundle?platform=ios&dev=false&minify=false&hot=true:5218:16
<unknown>
    index.ios.bundle?platform=ios&dev=false&minify=false&hot=true:1475:1078
loadModuleImplementation
    index.ios.bundle?platform=ios&dev=false&minify=false&hot=true:127:8
guardedLoadModule
    index.ios.bundle?platform=ios&dev=false&minify=false&hot=true:63:37
_require
    index.ios.bundle?platform=ios&dev=false&minify=false&hot=true:54:18
<unknown>
    index.ios.bundle?platform=ios&dev=false&minify=false&hot=true:77149:9

This is after a fresh install of 0.28 using react-native init Home, upgrading React and RN to ^15.2.0-rc.1 and ^0.29.0-rc.0 respectively, then running react-native upgrade. Node version is 6.1.0 but also did it in 4.

beinginorbit avatar Jun 28 '16 04:06 beinginorbit

cc @grabbou I believe we had faced the same issue.

@LeBlaaanc can you provide a sample project demonstrating the issue?

satya164 avatar Jun 28 '16 10:06 satya164

@satya164 does it just straight out of react-native init Foo.

beinginorbit avatar Jun 28 '16 14:06 beinginorbit

Yeah, had it as well, cc: @martinbigio as you were looking for other repros.

grabbou avatar Jun 28 '16 14:06 grabbou

I've faced same issue after upgrading from 0.28 to 0.29 RC0. I can't solve it so I've downgraded back to 0.28.

alexHlebnikov avatar Jun 29 '16 05:06 alexHlebnikov

please check this https://github.com/facebook/react-native/pull/8091 because the env is set to dev=false by default in this PR shipped in RN0.29RC0 I've mentioned the issue there, and you can solve the issue by using the old js bundle path jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; or launching the patch https://github.com/facebook/react-native/commit/9845f49581023302fcb33487bd6df2f7ce8825fa manully

nihgwu avatar Jun 30 '16 14:06 nihgwu

I'm facing the same issue.

pavlelekic avatar Jul 13 '16 12:07 pavlelekic

If I leave dev=true then I'm not able to have a production build, I'm stuck with the slow dev version :(

pavlelekic avatar Jul 13 '16 14:07 pavlelekic

Having the same issue on [email protected]... any suggestion?

mmazzarolo avatar Sep 14 '16 15:09 mmazzarolo

I just randomly started experiencing this as well, anyone find a solution?

arilitan avatar Nov 17 '16 02:11 arilitan

Been seeing this issue for multiple releases. Developing without it is extremely frustrating

jeremyong avatar Nov 24 '16 20:11 jeremyong

Hi guys, Suddenly my hot reloading stopped working with this error message. It turned out that I set __DEV__=false in the Development Menu by mistake. Checking the tick back gets rid of the error and Hot Reload works as before.

I understand that this is not a good compromise if you want to develop with hot reloading and __DEV__=false, but in my case I had just triggered it by mistake so hopefully this comment could still help somebody.

fabriziomoscon avatar Dec 14 '16 16:12 fabriziomoscon

For me this error occurs in Dev mode, when "JS Dev Mode" is disabled, but "Enable Hot Reloading" is also enabled.

Disabling "Enable Hot Reloading" fixes it, but sometimes you want hot reloading without JS dev mode enabled.

codebymikey avatar Feb 28 '17 13:02 codebymikey

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

hramos avatar Jul 20 '17 21:07 hramos