bberak / react-native-game-engine-handbook

A React Native app showcasing some examples using react-native-game-engine 🐒✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot run web example

buksy90 opened this issue · comments

Hi, I have an issue with running an examples in web browser (it works fine for android device using QR code).

When I hit "npm ci && npm start" and then uses "Run in web browser" in Metro bundler, I get following errors (each after fixing previous one):

1. Cannot compile due to the inaccessible Donkey kong due to DMCA takedown. Ok, nevermind, I fix this one by commenting out DonkeyKong component and import statement.

[23:20:53] C:/dev/react-native-game-engine-handbook/node_modules/react-native-donkey-kong/src/systems/power-ups.js
[23:20:53] Module not found: Can't resolve '../components/mario/mario-idling-hammering.gif' in 'C:\dev\react-native-game-engine-handbook\node_modules\react-native-donkey-kong\src\systems'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
  1. Cannot resolve back.png file because there are only "back@Xx.png" versions. Okay, I fixed by referencing back@2x.png directly (same error comes for close.png and logo.png
[23:21:58] C:/dev/react-native-game-engine-handbook/app/table-of-contents/backButton.js
[23:21:58] Module not found: Can't resolve './images/back.png' in 'C:\dev\react-native-game-engine-handbook\app\table-of-contents'
  1. This one is tricky, expo-gl doesnt have react-dom in it's dependencies in package.json, it also only uses findDOMNode function and the call is wrapped in try & catch.
[23:32:32] C:/dev/react-native-game-engine-handbook/node_modules/expo-gl/build/Canvas.js
[23:32:32] Module not found: Can't resolve 'react-dom' in 'C:\dev\react-native-game-engine-handbook\node_modules\expo-gl\build'

Im not sure how to fix the last error, but Im thinking I must not be only one facing this or Im doing something very wrong :). Could you help?

Im using
node 6.14.9
npm 14.15.3
windows 10
expo 4.0.16
react-native-game-engine-handbook commit: 4f3dc5a

Hey @buksy90,

Sorry you had so many problems.. Just to clarify - are you trying to run the handbook in the web browser using Expo's React Native Web support?

If so, I'm afraid that the handbook was only written with iOS and Android support in mind.. The core library should probably still work - but I don't have any examples.. As for getting expo-gl working on the web, I'm not sure how viable that is unless they explicitly support this (I was happy just to get it working on iOS and Android).

expo-gl requires that you also install and configure expo-gl-cpp.

There is also a dedicated React Game Engine library that supports web only (it might be more suitable to your needs).

Again, apologies if I have misunderstood..

Hi @bberak, thanks for explanation, I thought the examples are supposed to run on all three platforms. Good to know its not a true and I dont have just some stupid error :).

I would prefer to develop using browser on web platform and check the application using phone only occasionally after some bigger updates. Mostly because Im really beginner with React Native, but have many experiences with web. I will check if theres any easy solution :).