Convex-helpers ERROR
Type error: Type 'Iterable<FromType>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
14 | let index = 0;
15 | list = await list;
16 | for (const item of list) {| ^ 17 | promises.push(asyncTransform(item, index)); 18 | index += 1; 19 | } I get that error when doing: npm run build. How can I fix it? Thanks!
20 Replies
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!
Hi @Llabe, hm looks like convex-helpers is compiled to use syntax that you can't use in your environment. Where are you using this library?
I am using it in my convex file, like schema and functions. Let me check if I may be using it by mistake somewhere else
No this isn't your mistake probably
What kind of app are you building?
Is it a mobile app with expo, is it a Vite app, is it Next.js?
Nextjs
14
This are the places where I use convex-helpers

I can send you the github repo if needed
What's your tsconfig.json look like?
{
/* This TypeScript project config describes the environment that
* Convex functions run in and is used to typecheck them.
* You can modify it, but some settings required to use Convex.
/
"compilerOptions": {
/ These settings are not required by Convex and can be modified. /
"allowJs": true,
"strict": true,
"moduleResolution": "Bundler",
"jsx": "react-jsx",
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
/ These compiler options are required by Convex /
"target": "ESNext",
"lib": ["ES2021", "dom"],
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"isolatedModules": true,
"noEmit": true
},
"include": ["./**/"],
"exclude": ["./_generated"]
}
Not this one, but the one one level above this
at the root of your repo
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/": ["./src/"]
}
},
"include": ["next-env.d.ts", "/*.ts", "/.tsx", ".next/types/**/.ts"],
"exclude": ["node_modules"]
}
Huh, that looks fine. This is a typechecking error, what's the comand that you run that makes you see this error?
npm run build
and what does that do, does that run a typecheck?
is it
next build
?yes
"build": "next build",
It seems there's another tsconfig.json being used
sure want to share the project?
What do you mean another tsconfig?
I can send you the project, I fine
@Tom I belive I may have fixed it, according to AI I have to add: "downlevelIteration": true to the tsconfig
And I was adding it to the convex one, not the global one
I am going to try to deploy, and let you know
oh interesting!
cool, good to know that that seems to matter
@Tom It works on production, deployed on vercel. Thank u so much for the help!
nice!