gabrielw
gabrielw2mo ago

Convex Helpers build errors

Hey happy new year all, I recently updated my convex-helpers npm package to the latest version (0.1.67), and have been working off of the convex sass starter repo. I seem to be getting the Type error when running yarn build:
./node_modules/convex-helpers/index.ts:16:22
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 | }
error Command failed with exit code 1.
./node_modules/convex-helpers/index.ts:16:22
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 | }
error Command failed with exit code 1.
I am wondering if anyone might have any recommendations, or knowledge of any packages/modifications needed in order to resolve this. Currently using convex npm version 1.13.2. (Not sure if updating convex will cause other breaking changes). Thank you!
4 Replies
Convex Bot
Convex Bot2mo 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!
fugufish
fugufish2mo ago
check your compilerOptions in tsconfig.json, target looks like it might be wrong
lee
lee2mo ago
i'm also curious what your tsconfig looks like in general. convex-helpers has its own tsconfig which has the right target, so i'm not sure why your codebase would be compiling it with the wrong target
gabrielw
gabrielwOP2mo ago
yeah, I changed the target on my compilerOptions from "es" to "es2015" and am now building successfully. Heres the rest of my tsconfig now - |
{
"compilerOptions": {
"target": "es2015",
"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": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
{
"compilerOptions": {
"target": "es2015",
"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": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

Did you find this page helpful?