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

Expo: Unable to resolve "class-validator" #855

Open
ajaffie opened this issue May 14, 2024 · 11 comments
Open

Expo: Unable to resolve "class-validator" #855

ajaffie opened this issue May 14, 2024 · 11 comments
Assignees

Comments

@ajaffie
Copy link

ajaffie commented May 14, 2024

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.

@kaushalkapasi
Copy link
Contributor

Hey @ajaffie, thanks for raising this issue. Let us investigate and we'll get back to you shortly!

@kaushalkapasi kaushalkapasi self-assigned this May 14, 2024
@kaushalkapasi
Copy link
Contributor

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)

@ajaffie
Copy link
Author

ajaffie commented May 16, 2024

@kaushalkapasi Sure!

  • Node version: 18.18.2
  • Using NPM 9.8.1
  • No special configurations.

@kaushalkapasi
Copy link
Contributor

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!

@ajaffie
Copy link
Author

ajaffie commented May 16, 2024

@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).

@kaushalkapasi
Copy link
Contributor

Hm interesting, would it be possible for you to share a minimum reproduction so I can investigate this further?

@ajaffie
Copy link
Author

ajaffie commented May 17, 2024

@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

@kaushalkapasi
Copy link
Contributor

@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!

@leslie-lau
Copy link

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?

@leslie-lau
Copy link

HI @ajaffie have you had a chance to take a look at our update and does that fix the issue you were seeing?

@ajaffie
Copy link
Author

ajaffie commented Jun 10, 2024

@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!

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

No branches or pull requests

3 participants