Skip to content
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

[0.14.0] Problem with React-Native #371

Closed
BjoernRave opened this issue Oct 21, 2020 · 6 comments
Closed

[0.14.0] Problem with React-Native #371

BjoernRave opened this issue Oct 21, 2020 · 6 comments

Comments

@BjoernRave
Copy link

The new version 0.14.0 works great on web, but when I tried to upgrade my react-native app it failed. I downgraded my server and app back to 0.13.2 and it was working again.

this is the error log:

TypeError: _1.registerType is not a function. (In '_1.registerType("array", {
    constructor: ArraySchema,
    getProxy: getArrayProxy
  })', '_1.registerType' is undefined)
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
* /Users/bjoern/projects/arithmeticgame/node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
* /Users/bjoern/projects/arithmeticgame/node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:9:32 in ErrorUtils.setGlobalHandler$argument_0
* /Users/bjoern/projects/arithmeticgame/node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
* /Users/bjoern/projects/arithmeticgame/node_modules/regenerator-runtime/runtime.js:293:29 in invoke
* /Users/bjoern/projects/arithmeticgame/node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
* /Users/bjoern/projects/arithmeticgame/node_modules/regenerator-runtime/runtime.js:154:27 in invoke
* /Users/bjoern/projects/arithmeticgame/node_modules/regenerator-runtime/runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:14 in _callTimer
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/Core/Timers/JSTimers.js:181:14 in _callImmediatesPass
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/Core/Timers/JSTimers.js:441:30 in callImmediates
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:387:6 in __callImmediates
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 in __guard$argument_0
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
* /Users/bjoern/projects/arithmeticgame/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue
@endel
Copy link
Member

endel commented Oct 21, 2020

Hi @BjoernRave, I've just tried and failed to reproduce this, could it be that your package.json is specifying a previous version of @colyseus/schema? You should be fine to remove @colyseus/schema as a dependency from your project since colyseus already depends on the correct version needed

@BjoernRave
Copy link
Author

I don't have @colyseus/schema specified as dependency

@serjek
Copy link

serjek commented Nov 16, 2020

Hello @BjoernRave I would recommend first to set up a clean project and try to get it reproduced there. From what I can see there is something wrong with schema bindings. Also try to remove node_modules and package.lock and npm i again. I use RN 63.3 + colyseus haxe and it is working fine (except wss ping-pong handling on RN side)

@BjoernRave
Copy link
Author

BjoernRave commented Nov 23, 2020

okay, so I really tried to make it work, but failed so I stripped out everything from my app, but colyseus and the error persists.

This is the repro: https://github.com/BjoernRave/colyseus14-RN-repro

Just run yarn and yarn start

@endel
Copy link
Member

endel commented Nov 24, 2020

Hi @BjoernRave, I've managed to reproduce it with your repository, thanks for providing it!

It seems @colyseus/schema had a circular dependency issue and it has been fixed now on @colyseus/schema@1.0.4 - removing your yarn.lock and installing the dependencies again should get rid of the issue!

(It's strange that I did not experience this error outside of React Native 😨 )

Let me know if that works for you! Cheers!

@BjoernRave
Copy link
Author

Yes, now it works.

Thank you very much for responding so quick. Appreciate your work on this project. It has been a pleasure working with it so far :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants