Convex Ents not working after updating to 0.5.0

This code now throws this error:
const chatsFromTheUser = await ctx
.table("users")
.getX("clerkId", identity.tokenIdentifier)
.edge("chats")
.map(async (chat) => ({
// Type error: Parameter 'chat' implicitly has an 'any' type.
...chat,
users: await chat.edge("users"),
}));

chatsFromTheUser.forEach((chat) => {
const userIds = chat.users.map((user) => user.clerkId);
if (userIds.includes(user1.clerkId) && userIds.includes(user2.clerkId)) {
throw new ConvexError("Chat already created.");
}
});
const chatsFromTheUser = await ctx
.table("users")
.getX("clerkId", identity.tokenIdentifier)
.edge("chats")
.map(async (chat) => ({
// Type error: Parameter 'chat' implicitly has an 'any' type.
...chat,
users: await chat.edge("users"),
}));

chatsFromTheUser.forEach((chat) => {
const userIds = chat.users.map((user) => user.clerkId);
if (userIds.includes(user1.clerkId) && userIds.includes(user2.clerkId)) {
throw new ConvexError("Chat already created.");
}
});
7 Replies
Michal Srb
Michal Srbβ€’11mo ago
@FleetAdmiralJakob πŸ—• πŸ—— πŸ—™ are you on latest version of all packages? Can you share your deps from package.json? If you can’t resolve it downgrade back for now, there’s no functional change only the change to type: β€œmodule”
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
my package.json (removed the not informative parts):
{
"dependencies": {
"@clerk/nextjs": "^5.0.3",
"@clerk/shared": "^2.0.0",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@serwist/next": "9.0.2",
"@serwist/precaching": "9.0.2",
"@serwist/sw": "9.0.2",
"@t3-oss/env-nextjs": "^0.10.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",


"convex": "^1.11.2",
"convex-ents": "^0.5.0",
"convex-helpers": "^0.1.35",


"framer-motion": "^11.1.7",
"geist": "^1.3.0",
"jiti": "^1.21.0",
"lucide-react": "^0.376.0",
"next": "^14.2.3",
"next-themes": "^0.3.0",
"providers": "link:providers",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.51.3",
"react-icons": "^5.1.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.4"
},
"devDependencies": {
"@total-typescript/ts-reset": "^0.5.1",
"@types/eslint": "^8.56.10",
"@types/node": "^20.12.7",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^9.1.1",
"eslint-config-next": "^14.2.3",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5"
},
"ct3aMetadata": {
"initVersion": "7.30.0"
},
"packageManager": "pnpm@9.0.6"
}
{
"dependencies": {
"@clerk/nextjs": "^5.0.3",
"@clerk/shared": "^2.0.0",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@serwist/next": "9.0.2",
"@serwist/precaching": "9.0.2",
"@serwist/sw": "9.0.2",
"@t3-oss/env-nextjs": "^0.10.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",


"convex": "^1.11.2",
"convex-ents": "^0.5.0",
"convex-helpers": "^0.1.35",


"framer-motion": "^11.1.7",
"geist": "^1.3.0",
"jiti": "^1.21.0",
"lucide-react": "^0.376.0",
"next": "^14.2.3",
"next-themes": "^0.3.0",
"providers": "link:providers",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.51.3",
"react-icons": "^5.1.0",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.4"
},
"devDependencies": {
"@total-typescript/ts-reset": "^0.5.1",
"@types/eslint": "^8.56.10",
"@types/node": "^20.12.7",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"eslint": "^9.1.1",
"eslint-config-next": "^14.2.3",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5"
},
"ct3aMetadata": {
"initVersion": "7.30.0"
},
"packageManager": "pnpm@9.0.6"
}
Michal Srb
Michal Srbβ€’11mo ago
That looks good, have you tried all usual suspects: - npm install - restart typescript server - restart VS Code ? If that doesn't help can you boil it down? (remove tables from schema and remove files from convex/ while preserving the error)
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
i tried out the usual suspects yes. the error even occurs on pnpm build. I will try to boil it down ok, I deleted the _generated dir and reran pnpm dlx convex dev and now found the original error: Cannot find module 'convex-ents' or its corresponding type declarations.ts(2307) that's seems like the reason of the anys (I now updated to convex-ents 0.5.1 (seems like to have no impact))
Michal Srb
Michal Srbβ€’10mo ago
So you’re using pnpm, and it looks like switching from commonjs to module broke things. I’ll look more into it tomorrow. Hey @FleetAdmiralJakob πŸ—• πŸ—— πŸ—™ , can you try upgrading to convex-ents@latest and let me know if it fixed your issue? Thanks
FleetAdmiralJakob πŸ—• πŸ—— πŸ—™
great! works! thank you very much you just reverted the type: "module" change, right?
Michal Srb
Michal Srbβ€’10mo ago
There are some unrelated changes (to migration helpers)

Did you find this page helpful?