-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Expected JavaScript, but got content type 'application/javascript; chartset=UTF-8'. Check that your internet connection is working. #326
Comments
@justinr1234 Reinstalling OS shouldn't be needed. All more or less recent version of Node should be supported, no need to reinstall it. Wachman is not used by starter kit. Global Expo is not used by starter kit. XDE is not used by starter kit. Starter kit is self-contained. No need to reinstall something. The problem seems due to implementation of mocking of React Native packager inside starter kit or inside Haul. The starter kit uses HTTP standard and sets I will take a look. |
@justinr1234 Could you be more specific and provide reproduction steps and exact stack trace or screenshot of the error? |
@Vlasenko I think it's a red herring because the error messaging is complaining about the proper type. In code it usually checks MimeType, which doesn't include the optional My reproduction steps are just pulling the project fresh and following the regular install steps for iOS only. |
0x6180001b8720> (parent: <ABI15_0_0RCTBridge: 0x6000000d4040>, executor: ABI15_0_0RCTJSCExecutor)
Sep 4 08:01:37 Justins-MBP Exponent[88409]: 2017-09-04 08:01:37.646 [fatal][tid:main] Could not connect to development server.
Sep 4 08:01:38 Justins-MBP Exponent[88409]: [] nw_connection_get_connected_socket_block_invoke 347 Connection has no connected handler |
@justinr1234 Could you check if removing |
@Vlasenko Thanks for the suggestion, much appreciated: Tried removing that from everywhere in the entire project including there, as well as disabling the live reload middleware altogether and that didn't fix it. I really think it's a red herring in the way they are defaulting to their error message when they are using this error message function as a catch all. |
@justinr1234 Thanks, your last log was helpful. This error message is misleading. The problem is due to our development server now is using LAN IP, but when we are starting iOS Simulator we are using |
@Vlasenko Appears to have same issue: Sep 4 08:15:21 Justins-MBP CoreSimulatorBridge[89259]: Requesting installation of file:///Users/justin/.expo/ios-simulator-app-cache/Exponent-1.19.0.app/ with options: { |
I just tested this issue and I can confirm I have started to see it too. |
@justinr1234, @mairh Okay, I'm looking more thoroughly |
Also another tidbit, I can access the regular web server in mobile safari and I also turned on the logging to verify I'm receiving the requests (aka my internet connection is working):
|
@mairh @justinr1234 If you downgrade to |
@mairh @justinr1234 I'm suspecting that this problem was introduced with commit: |
@Vlasenko Still fails ... after clearing all my temp folders and reinstalling everything and changing deps. |
@justinr1234 Please attach |
@Vlasenko Doesn't exist |
@justinr1234 It must exist. The file |
Here you go (running only iOS) - when running before the commit 852b990
When running with latest master
|
{"name":"expo","hostname":"Justins-MBP.attlocal.net","pid":85132,"type":"project","project":"/Users/justin/bv/ironworks/.expo/ios","level":20,"tag":"expo","msg":"Local server listening at http://:::19000","time":"2017-09-04T00:01:30.781Z","v":0} |
@Vlasenko Maybe "downloading latest version of Expo"? Since they are on a newer version than 15.0 |
@justinr1234 You can try. I have tested latest version of the kit on iOS and I don't have this issue |
What I'm saying is maybe the simulator and phone is launching the Expo App targeted for version 20.0 and we're running on 15.0 and so our bundle is incompatible with the latest app. I'm not quite sure how to update the starter to 20.0 Expo as I"m assuming we'd need to update all the libraries for the newer React Native. |
@justinr1234 No, we cannot do it now. Since it means we need to upgrade to React 16, and not all deps we are using are ready for React 16. |
@justinr1234 Okay, I have selected 'Reset content and Settings' in the Simulator and restarted the kit. It downloaded the latest Expo Client version to the Simulator and now I see this error. So, yes, the problem is with incompatibility of the latest Expo version with the kit. I will try to fix the compatibility. If I will unable to do, there is still a way to fix this issue, we can downgrade to |
I tried that including the reset and it still didn't work. I believe it is downloading the latest Expo App regardless of the version of xdl and exp. I believe it could be a problem in the Expo build tool if we can prove it always downloads the latest regardless of xdl and exp version. |
@justinr1234 Okay, doesn't really matter. I think this is really a bug in Expo Client, which doesn't support |
@Vlasenko Thanks for working on that, I hope that works. Fwiw I think this commit introduced the problem expo/expo@e6a3f99#diff-0e96160b8c1ac0b664b08ada4f2b2f12R89 This particular error code looks like it has nothing to do with the header and is just falling into that error code messaging generically. It looks like it falls into that error messaging on any error with RCTJavaScriptLoader |
@justinr1234 Yes looks like this commit is the source of the problem. Btw, I have commited workaround for |
@justinr1234 I think it is the header. At least it works for me now after the 4a6e7e0 |
@mairh @justinr1234 Could you confirm is this error gone for you after the last commit? |
@Vlasenko still there |
@justinr1234 But the error cannot be the same. It should be different at least |
I wonder if we can debug what status code is coming back? |
@justinr1234 It works for me. I don't understand how it started working for me now, but not for you |
@justinr1234 Are you sure you have pulled in the latest source code of the kit? Do you see the code for patching Content-Type from the last commit in your source code? |
Ok I wiped my ~/.expo and completely deleted and recloned the starter plus wiped my simulator and it appears to be fixed. Seeing a different error but it looks like the one in this issue is fixed. Thanks a ton for your hard work @Vlasenko |
@justinr1234 This is because you forgot to do |
All good now, it was because I accidentally had another console tab going. Was doing all this from my phone remotely ... Thanks again for your help! |
@Vlasenko I think it's a bug in the react native code, not in Expo actually: https://github.com/facebook/react-native/blob/master/React/Base/RCTJavaScriptLoader.mm#L276 Think I'll submit a PR to react-native to fix it, thanks again for working on this. |
@justinr1234 Yep, looks like you are right. Thank you for exploring this further! |
I can also confirm it is working with the latest master. However, I am facing the same problem with my fork after taking the latest changes from your last 2 commits. |
@mairh Only this commit is relevant for solving the problem: If you still have the issue in your fork, check whether you applied the commit above correctly. Also check that getting http://localhost:3020/index.mobile.bundle has Content-Type without |
Yeah. What I mean is that I replaced the whole webpack.run file. You mean This is the output of the bundle https://gist.github.com/mairh/b7dc75073c05b042c1a4507c08f249c7 |
@mairh No, I mean response header $ curl -s -I -X GET http://localhost:3020/index.mobile.bundle
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: application/javascript
Content-Length: 4220118
Access-Control-Allow-Origin: *
Vary: Accept-Encoding
Date: Tue, 05 Sep 2017 12:34:52 GMT
Connection: keep-alive |
Ah on the network tab. I wonder why in my fork if I try to access |
@mairh That's what happened when I removed the mime setting here: https://github.com/sysgears/apollo-universal-starter-kit/blob/master/tools/webpack.run.js#L391 On my fork, I just returned back to the last working version and then did a |
ah....recreating |
Seeing this error on load:
https://github.com/expo/expo/blob/master/ios/Exponent/Api/EXJavaScriptResource.m#L142
I've tried everything short of reinstalling my OS. Changed node, changed watchman, global expo, used XDE, etc, etc, etc...
Anyone have ideas?
The text was updated successfully, but these errors were encountered: