React-360: How to run the examples?

Created on 24 Apr 2017  路  8Comments  路  Source: facebookarchive/react-360

Description

Documentation request: it would be great if you could provide instructions on how to run the examples.

Expected behavior

Since I couldn't find any instructions, I tried to run the ModalSample example as follows:

  • Copy package.json from the demo project (generated using react-vr init) into the ModalSample directory
  • Run npm install in that directory to install the requirements
  • Run npm start

The expected behavior would be that it would work like that.

Actual behavior

When running npm start, it starts up, but when I load it in the browser, I get:

Loading dependency graph, done.
Bundling `vr/client.js`
  Analysing...Error: Unrecognized platform: vr
    at DependencyGraph._getRequestPlatform (/Users/raf/vr/react-vr/Examples/ModelSample/node_modules/react-native/packager/src/node-haste/index.js:334:13)
    at load.then (/Users/raf/vr/react-vr/Examples/ModelSample/node_modules/react-native/packager/src/node-haste/index.js:294:23)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Reproduction

  • Copy package.json from the demo project (generated using react-vr init) into the ModalSample directory
  • Run npm install in that directory to install the requirements
  • Run npm start
  • open browser at http://localhost:8081/vr/

Solution

Would be great if you could provide some simple instructions on how to run the examples!

Additional Information

  • React VR version: react-vr (I think?)
  • Operating System: MacOS
  • Graphics Card: /
  • Browser: Chrome 57
  • VR Device: Browser

Most helpful comment

It would be great if the examples were hosted on the github.io page, right?

All 8 comments

It would be great if the examples were hosted on the github.io page, right?

You should try the opposite -- rather than copying package.json into the sample dir, copy the sample code and assets into a new project directory. If you look at your generated directory, there are a number of configuration files that determine the behavior of the project, it's much more than just the package.

We're currently investigating the best ways to put the examples up online for you to browse. In the immediate future, I'll consider embedding them into our github.io page, but I'd like to explore a fiddle-like live editor in the long term.

this isn't one of our samples, but here is a live app built with React VR:
http://vr.britishmuseum.org/

Thanks Andrew and Amber! Would be great to see them on the github.io page and even cooler to be able to play around with the example source code :)

I tried to copy the example code into the demo folder, but I'm still getting Analysing...Error: Unrecognized platform: vr.

Here are the steps I followed:

  • copy static_assets, vr, and index.vs.js from ModalSample into the demo folder
  • run yarn install
  • run npm start
  • open in Chrome 57

I'm running node v7.5.0.

Did you copy it into a new directory created from the react-vr cli?
Your directory should have a file in it called rn-cli.config.js; without this, the packaging server is not going to be able to know what the vr platform is. You should also check for the presence of .babelrc and .watchmanconfig files in your project root.

Yes that was it: I was missing rn-cli.config.js! Thanks a lot!

i can't run too in chrome :( can u help me ?

I also just came across this project, and could not find any way to run the samples. What is the point of providing samples if they do not run out of the box, and are not provided with any instructions on how to get them running...?!? More than two years later and this still has not been improved...!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanf12 picture ryanf12  路  3Comments

wuno picture wuno  路  3Comments

danbugs picture danbugs  路  3Comments

stu60610 picture stu60610  路  4Comments

muhammetdemirci picture muhammetdemirci  路  3Comments