Llabe
Llabe3w ago

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
Convex Bot
Convex Bot3w 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
ballingt3w ago
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?
Llabe
LlabeOP3w ago
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
ballingt
ballingt3w ago
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?
Llabe
LlabeOP3w ago
Nextjs 14
Llabe
LlabeOP3w ago
This are the places where I use convex-helpers
No description
Llabe
LlabeOP3w ago
I can send you the github repo if needed
ballingt
ballingt3w ago
What's your tsconfig.json look like?
Llabe
LlabeOP3w ago
{ /* 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"] }
ballingt
ballingt3w ago
Not this one, but the one one level above this at the root of your repo
Llabe
LlabeOP3w ago
{ "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"] }
ballingt
ballingt3w ago
Huh, that looks fine. This is a typechecking error, what's the comand that you run that makes you see this error?
Llabe
LlabeOP3w ago
npm run build
ballingt
ballingt3w ago
and what does that do, does that run a typecheck? is it next build?
Llabe
LlabeOP3w ago
yes "build": "next build",
ballingt
ballingt3w ago
It seems there's another tsconfig.json being used sure want to share the project?
Llabe
LlabeOP3w ago
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
ballingt
ballingt3w ago
oh interesting! cool, good to know that that seems to matter
Llabe
LlabeOP3w ago
@Tom It works on production, deployed on vercel. Thank u so much for the help!
ballingt
ballingt3w ago
nice!

Did you find this page helpful?