Issue with asyncMap in convex-helpers and Next.js 14.2.5
I'm getting this issue when trying to build my next.js app within my monorepo. I'm using the convex-helpers in my backend package.
I'm not sure what i can do, my target is set to ESNext for both next.js and my backend package.
10 Replies
Try adding
"target": "es2015"
to compilerOptions
in your top level tsconfig.json
(the one used by Next.js)
It sure would be nice for TypeScript to only consider the types from convex
and not any runtime behavior, but that requires a more complicated setup.
Did you use one of our templates to initiate the project?Yeah it's actually the convex expo monorepo starter. But without any of the apps in the starter though, as we migrated a bunch from our old repo, recently.
I tried changing the targets 1 by one, both for the next.js tsconfig and the others present in the repo. I know for a fact we changed the one inside the /convex folder, to have javascript sets, but changing that back to es2015 also doesnt work.
Higher target should be fine. The error comes from Next.js build, so it must be the tsconfig used by Next.js
Can you add
skipLibCheck
?Yeah. Hmm, i'll see if i can gather a bit more information to go from
Haven't tried that yet, will do!
Ohh its already there, so here are our current tsconfigs
next js:
packages/backend/convex:
monorepo root:
Pretty odd. I also don't even use the asyncMap function, so it's a bit annoying i cant just have next.js ignore that completely.
I've tried various tsconfig settings now. Cleaned my cache each type, nothing seems to change it unfortunately.
Okay, i got it working now. Unsure if it truly was the issue. But clearing the turbo cache and adding this worked:
"downlevelIteration": true,
thx pal, had the same issue and
"downlevelIteration": true
works perfectlyhey guys, i have a similar setup and running into the same after upgrading to
convex-helpers@0.1.52
Is the conclusion to have the following lines in the nextjs tsconfig.json
?
I can't seem to get rid of the error even though the app runs fine and I can do:
successfully...
Any ideas?You made these changes and you still have a the TypeScript error?
Yep
@David Alonso could you share the code, and if you can a repro? You say running into the same, could you show the error just to be sure?
Will follow up soon, currently i have a very broken build I'm working on which might hide things