shanghuang
shanghuang
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
I love the concept and idea behind convex, so wanna try it out and introduce to my friends !!
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
Problem solved! Thanks @jamwt , and Thanks @Michal Srb as well. I should have checked the parent folder.
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
No description
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
Hi Michal, No, I don't have .pnp.cjs in the project folder.
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
No description
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
No description
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
Hi Tom, after installing a clean version of MacOS, installed node through Brew. It still jumps up the same message.
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
My guess is that it has somethign to do with the previous yarn I installed. But, at this moment, i can't spot the error.
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
that's what i thought so. But I don't have yarn on my develop machine, and i can't find a .pnp.cjs on the machine.
21 replies
CCConvex Community
Created by shanghuang on 9/7/2023 in #support-community
Could not resolve "convex/server"
Hi Tom, thanks for you reply. I wan't able to figure this out yet. Yarn was not used in the project. I was following the quickstart guide for nextjs. using npm. I am sure the package is installed. I was able to
npx convex import tasks sampleData.jsonl
npx convex import tasks sampleData.jsonl
and sees the data on Convex dashboard. When it gets to preparing Convex functions.... for tasks.ts, it jumps up this erorr:
✔ 06:59:40 Convex functions ready! (1.02s)
⠇ Preparing Convex functions...
✘ [ERROR] Could not resolve "convex/server"

convex/_generated/server.js:20:7:
20 │ } 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:45:33:
45 │ "packageDependencies": [
╵ ^

You can mark the path "convex/server" as external to exclude it from the bundle, which will
remove this error.
✔ 06:59:40 Convex functions ready! (1.02s)
⠇ Preparing Convex functions...
✘ [ERROR] Could not resolve "convex/server"

convex/_generated/server.js:20:7:
20 │ } 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:45:33:
45 │ "packageDependencies": [
╵ ^

You can mark the path "convex/server" as external to exclude it from the bundle, which will
remove this error.
Here is the package.json
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@types/node": "20.5.9",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"convex": "^1.2.1",
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"next": "13.4.19",
"postcss": "8.4.29",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.2.2"
}
}
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@types/node": "20.5.9",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"convex": "^1.2.1",
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"next": "13.4.19",
"postcss": "8.4.29",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.2.2"
}
}
I am using npm 10.0.0 npx 10.0.0
21 replies