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.
I'm not sure what i can do, my target is set to ESNext for both next.js and my backend package.
yarn run v1.22.19
│ $ next build
│ ▲ Next.js 14.2.5
│ - Environments: .env.production
│
│ Creating an optimized production build ...
│ ✓ Compiled successfully
│ Linting and checking validity of types .Failed to compile.
│
│ ../../node_modules/convex-helpers/index.ts:15:22
│ Type error: Type 'Iterable<FromType>' can only be iterated through when using the '--downlevelIteration' flag
│ or with a '--target' of 'es2015' or higher.
│
│ 13 | const promises: Promise<ToType>[] = [];
│ 14 | let index = 0;
│ > 15 | for (const item of await list) {
│ | ^
│ 16 | promises.push(asyncTransform(item, index));
│ 17 | index += 1;
│ 18 | }
│ error Command failed with exit code 1.
│ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
│ command finished with error: command (/Users/oscklm/Code/work/flimmer-monorepo/apps/dashboard) /var/folders/rn
│ /rd71yf_115b60w3h6jfv16840000gn/T/yarn--1722335907430-0.34139340179029687/yarn run build exited (1)
└────>
@flimmer/dashboard#build: command (/Users/oscklm/Code/work/flimmer-monorepo/apps/dashboard) /var/folders/rn/rd71yf_115b60w3h6jfv16840000gn/T/yarn--1722335907430-0.34139340179029687/yarn run build exited (1) yarn run v1.22.19
│ $ next build
│ ▲ Next.js 14.2.5
│ - Environments: .env.production
│
│ Creating an optimized production build ...
│ ✓ Compiled successfully
│ Linting and checking validity of types .Failed to compile.
│
│ ../../node_modules/convex-helpers/index.ts:15:22
│ Type error: Type 'Iterable<FromType>' can only be iterated through when using the '--downlevelIteration' flag
│ or with a '--target' of 'es2015' or higher.
│
│ 13 | const promises: Promise<ToType>[] = [];
│ 14 | let index = 0;
│ > 15 | for (const item of await list) {
│ | ^
│ 16 | promises.push(asyncTransform(item, index));
│ 17 | index += 1;
│ 18 | }
│ error Command failed with exit code 1.
│ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
│ command finished with error: command (/Users/oscklm/Code/work/flimmer-monorepo/apps/dashboard) /var/folders/rn
│ /rd71yf_115b60w3h6jfv16840000gn/T/yarn--1722335907430-0.34139340179029687/yarn run build exited (1)
└────>
@flimmer/dashboard#build: command (/Users/oscklm/Code/work/flimmer-monorepo/apps/dashboard) /var/folders/rn/rd71yf_115b60w3h6jfv16840000gn/T/yarn--1722335907430-0.34139340179029687/yarn run build exited (1)