Enjin
Enjin4mo ago

React Native Quickstart Error

I'm following the docs to set up react-native with convex but running into this error:
✘ [ERROR] Could not resolve "convex/server"

convex/_generated/server.js:21:7:
21 │ } from "convex/server";
╵ ~~~~~~~~~~~~~~~

The Yarn Plug'n'Play manifest forbids importing "convex" here because it's not listed as a
dependency of this package:

../../../.pnp.cjs:16526:31:
16526 │ "packageDependencies": [\
╵ ~~

You can mark the path "convex/server" as external to exclude it from the bundle, which will remove
this error and leave the unresolved path in the bundle.
✘ [ERROR] Could not resolve "convex/server"

convex/_generated/server.js:21:7:
21 │ } from "convex/server";
╵ ~~~~~~~~~~~~~~~

The Yarn Plug'n'Play manifest forbids importing "convex" here because it's not listed as a
dependency of this package:

../../../.pnp.cjs:16526:31:
16526 │ "packageDependencies": [\
╵ ~~

You can mark the path "convex/server" as external to exclude it from the bundle, which will remove
this error and leave the unresolved path in the bundle.
Is there an easy way to resolve this?
7 Replies
Convex Bot
Convex Bot4mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
ballingt
ballingt4mo ago
It sounds like you might need to install convex
Enjin
EnjinOP4mo ago
I'm getting this error in my server cli when I add in the tasks.ts file. When I comment it out it says the server is running and functions are ready
ballingt
ballingt4mo ago
Are you using yarn? The error says that a parent directory has a .pnp.cjs file that doesn't have convex in it.
ballingt
ballingt4mo ago
Stack Overflow
The Yarn Plug'n'Play manifest forbids importing "XYZ" here because ...
Yarn 3.5 (stable) using ViteJS - I keep getting this same error for various third party packages. I'm lost on how to properly solve this. The message says I can mark "react" as external, ...
ballingt
ballingt4mo ago
If you're not trying to use yarn, get rid if these files in ancestor directories.
Enjin
EnjinOP4mo ago
Thanks, I had yarn in my root directory and that was causing the issue

Did you find this page helpful?