facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.23k forks source link

LocalHost refuses to connect after updating to 2.0.0 #370

Closed chrissafi closed 6 years ago

chrissafi commented 6 years ago

After updating react-vr to 2.0.0 I am unable to connect to my app. Below is error log & snap. What am I Missing?

0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'start' ] 2 info using npm@3.10.10 3 info using node@v6.11.3 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle ChurchTour@0.0.1~prestart: ChurchTour@0.0.1 6 silly lifecycle ChurchTour@0.0.1~prestart: no script for prestart, continuing 7 info lifecycle ChurchTour@0.0.1~start: ChurchTour@0.0.1 8 verbose lifecycle ChurchTour@0.0.1~start: unsafe-perm in lifecycle true 9 verbose lifecycle ChurchTour@0.0.1~start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\REACT_VR\ChurchTour\node_modules.bin;C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\nodejs\;C:\Users\chris\AppData\Local\Microsoft\WindowsApps;C:\Users\chris\AppData\Roaming\npm;C:\Program Files\Microsoft VS Code\bin 10 verbose lifecycle ChurchTour@0.0.1~start: CWD: D:\REACT_VR\ChurchTour 11 silly lifecycle ChurchTour@0.0.1~start: Args: [ '/d /s /c', 11 silly lifecycle 'node -e "console.log(\'open browser at http://localhost:8081/vr/\\n\\n\');" && node node_modules/react-native/local-cli/cli.js start' ] 12 silly lifecycle ChurchTour@0.0.1~start: Returned: code: 1 signal: null 13 info lifecycle ChurchTour@0.0.1~start: Failed to exec start script 14 verbose stack Error: ChurchTour@0.0.1 start: node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cli.js start 14 verbose stack Exit status 1 14 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at EventEmitter.emit (events.js:191:7) 14 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14) 14 verbose stack at emitTwo (events.js:106:13) 14 verbose stack at ChildProcess.emit (events.js:191:7) 14 verbose stack at maybeClose (internal/child_process.js:920:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5) 15 verbose pkgid ChurchTour@0.0.1 16 verbose cwd D:\REACT_VR\ChurchTour 17 error Windows_NT 10.0.15063 18 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" 19 error node v6.11.3 20 error npm v3.10.10 21 error code ELIFECYCLE 22 error ChurchTour@0.0.1 start: node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cli.js start 22 error Exit status 1 23 error Failed at the ChurchTour@0.0.1 start script 'node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cli.js start'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the ChurchTour package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cli.js start 23 error You can get information on how to open an issue for this project with: 23 error npm bugs ChurchTour 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls ChurchTour 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ]

image

List all the steps required to encounter the issue you're reporting. These steps should be clear and concise.

I deleted node_modules directory In the package.json file of my ChurchTour application I update react-vr, react-vr-web, and ovrui to "~2.0.0" I updated react to "16.0.0" I updated react-native to "~0.48.0" I update three to "^0.87.0" Reinstall your dependencies with npm install or yarn

An example of your code that reliably reproduces the issue is ideal. image

Solution

How can I connect to my application again?

Additional Information

andrewimm commented 6 years ago

I'd recommend updating your Node.js version. 6.11 is pretty old, and may no longer be supported by the underling React Native library.

jgwinner commented 6 years ago

6.12 might be pretty old but it was what seemed to be the 'release' version when I started a month ago and worked fine with 2.0.0 for a while. I did upgrade though. Just wanted to throw that out there.

For @chrissafi did you try a "Rip and Replace" upgrade? Create a new parent directory, create a directory with react-vr init then copy your code over? I tried that when I got errors initially and it worked fine for an upgrade.

andrewimm commented 6 years ago

@jgwinner I only suggested it because the server is part of React Native, and out of my control. I'm not sure if they've changed minimum dependencies, or what other changes they might have made, but I'm aware that many bug reports on the RN repo are solved by upgrading Node.

jgwinner commented 6 years ago

Understood, I'm usually an upgrade freak. In this case (and I can't prove it as it's now October and it shipped) I remember seeing 6.11 was current though last month. Went through that with my publisher.

My thought though is that there's something else going on. I'll try another upgrade (not rip and replace) and see how it goes, if I can duplicate @chrissafi 's problem.

Rip and replace works great, as long as package.json has any extra modules, and THAT file you've got to diff.

== John ==

bodo22 commented 6 years ago

I am getting the same error, tried installing with node 6.11.3/4 & latest 8.7.0. Getting these npm warnings after strictly following the current 2.0.0 release info:

npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated npm WARN react-native@0.48.4 requires a peer of react@16.0.0-alpha.12 but none is installed. You must install peer dependencies yourself. npm WARN react-test-renderer@15.4.2 requires a peer of react@^15.4.2 but none is installed. You must install peer dependencies yourself.

I have tried removing the last 2 dependencies by locking them to specific versions, but without success.

Initting a new project with react-vr-cli v0.3.6 throws the first 2 warnings.

Any tips on this would be greatly appreciated!

bodo22 commented 6 years ago

I managed to fix it with the help of this comment.

in your projects root folder in the file rn-cli.config.js you have to replace this line var blacklist = require('./node_modules/react-native/packager/blacklist');

with this

var blacklist = require('./node_modules/metro-bundler/src/blacklist');

if this affects all older projects, maybe update the release info? :)

jgwinner commented 6 years ago

I can confirm this error too.

Steps to reproduce

Take any 1.4.0 project

Follow the upgrade steps at https://github.com/facebook/react-vr/releases

Delete node_modules

run:

npm install

F:\ReactVR\SpaceGallery>npm start

> SpaceGallery@0.0.1 start F:\ReactVR\SpaceGallery
> node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node_modules/react-native/local-cli/cl
i.js start

open browser at http://localhost:8081/vr/

module.js:529
    throw err;
    ^

Error: Cannot find module './node_modules/react-native/packager/blacklist'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (F:\ReactVR\SpaceGallery\rn-cli.config.js:4:17)
    at Module._compile (module.js:624:30)
    at Module._extensions..js (module.js:635:10)
    at Object.require.extensions.(anonymous function) [as .js] (F:\ReactVR\SpaceGallery\node_modules\babel-register\lib\
node.js:152:7)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! SpaceGallery@0.0.1 start: `node -e "console.log('open browser at http://localhost:8081/vr/\n\n');" && node node
_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the SpaceGallery@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\John\AppData\Roaming\npm-cache\_logs\2017-10-16T01_34_03_321Z-debug.log

Also, I tried a "rip and replace" upgrade, by doing a fresh install, and moving all the code over. I also noticed two other changes in package.json:

From:

    "react-devtools": "^2.1.3",
    "react-test-renderer": "~15.4.1",

To:

    "react-devtools": "^2.5.2",
    "react-test-renderer": "16.0.0",

Should these be added to the upgrade instructions?

@bodo22 Great tip, thanks! That helped my other problem!

== John ==

yasicmd commented 6 years ago

@bodo22 thanks. works for me.

andrewimm commented 6 years ago

Release info has been updated.