Expo: Unable to resolve "class-validator"
Sometime after version 1.14, something changed that broke the package. I get this error during bundling:
Unable to resolve "class-validator" from "node_modules\@devcycle\react-native-expo-client-sdk\node_modules\@devcycle\types\index.cjs.js"
If I downgrade to 1.14, I no longer get the error. I'm using Expo SDK 50.
Hey @ajaffie, thanks for raising this issue. Let us investigate and we'll get back to you shortly!
Hey @ajaffie, could you provide some more information:
- Expo: SDK 50
- Node version?
- Are you using NPM / Yarn?
- version of NPM / Yarn
- are there any specific configurations (pnpm mode, linker)
@kaushalkapasi Sure!
- Node version: 18.18.2
- Using NPM 9.8.1
- No special configurations.
Hey @ajaffie we've published a newer version of the React-Native-Expo-Client-SDK (1.17.0)
"@devcycle/react-native-expo-client-sdk": "^1.17.0",
Could you try running npx expo install @devcycle/[email protected] and let me know if this issue persists?
Thanks!
@kaushalkapasi It bundles now, but the app just shows a black screen (on iOS). If I set logLevel in the options passed to withDevCycleProvider to debug, nothing is output.
Actually on the Android simulator, it says "There was a problem loading the project" and "Maximum call stack size exceeded".
My root _layout, which I wrap with withDevCycleProvider, is not rendered (checked with console.log).
Hm interesting, would it be possible for you to share a minimum reproduction so I can investigate this further?
@kaushalkapasi Here you go: https://github.com/ajaffie/devcycle-855-repro
There is one difference, in this repro the app isn't hanging or crashing. It does log the call stack exceeded error several times, though:
DEBUG root layout {"devCycleInit": false}
ERROR Unhandled promise rejection [RangeError: Maximum call stack size exceeded (native stack depth)]
DEBUG root layout {"devCycleInit": true}
ERROR Unhandled promise rejection [RangeError: Maximum call stack size exceeded]
DEBUG root layout {"devCycleInit": true}
ERROR Unhandled promise rejection [RangeError: Maximum call stack size exceeded]
ERROR Unhandled promise rejection [RangeError: Maximum call stack size exceeded]
ERROR Unhandled promise rejection [TypeError: Object is not a constructor]
ERROR Unhandled promise rejection [RangeError: Maximum call stack size exceeded]
You should just need to add an SDK key in src/app/_layout.tsx, npm install, npx expo prebuild --platform android, npm run android
@ajaffie thanks! I'll take a look and let you know my findings.
As an aside, we've also added a dedicated page with some React-Native Expo docs here. If you have any feedback / suggestions, we'd be happy to make the changes accordingly!
Hi @ajaffie we released version 2.0.0 of our React Native and React Native Expo SDKs which should contain a fix for the issues that you're seeing here. Could you give that a try and let us know if that resolves your issue?
HI @ajaffie have you had a chance to take a look at our update and does that fix the issue you were seeing?
@leslie-lau Sorry I was working on other things. Just gave it a shot and it seems to be fixed. I will let you know if it ends up actually not working. Thanks!
Hi @ajaffie just wanted to follow up to see if everything's working as expected! How's the fix looking?
Haven't noticed any issues, I think it's good!