#convex-helpers preventing my turbo build from running?

19 messages · Page 1 of 1 (latest)

spare pelican
#

I have no clue what is the reason behind this, ive tried multiple approaches to finding out the reason why this error is happening, but wihtout luck?

 flimmer git:(main) ✗ npx turbo run build --filter=admin-dashboard
• Packages in scope: admin-dashboard
• Running build in 1 packages
• Remote caching disabled
admin-dashboard:build: cache miss, executing 19cd75ee5e61ff3f
admin-dashboard:build: 
yarn run v1.22.21
$ next build
admin-dashboard:build:    ▲ Next.js 14.1.3
admin-dashboard:build:    - Environments: .env.production
admin-dashboard:build: 
admin-dashboard:build:    Creating an optimized production build ...
admin-dashboard:build:  ✓ Compiled successfully
   Linting and checking validity of types  ... ⨯ ESLint: Failed to load config "@repo/eslint-config/library.js" to extend from. Referenced from: /Users/oscdot/Repos/flimmer/.eslintrc.js
   Linting and checking validity of types  ...Failed to compile.
admin-dashboard:build: 
admin-dashboard:build: ../../node_modules/convex-helpers/index.ts:15:22
admin-dashboard:build: Type error: Type 'Iterable<FromType>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
admin-dashboard:build: 
admin-dashboard:build:   13 |   const promises: Promise<ToType>[] = [];
admin-dashboard:build:   14 |   let index = 0;
admin-dashboard:build: > 15 |   for (const item of await list) {
admin-dashboard:build:      |                      ^
admin-dashboard:build:   16 |     promises.push(asyncTransform(item, index));
admin-dashboard:build:   17 |     index += 1;
admin-dashboard:build:   18 |   }

Can anyone guide me in the right direction here?

scarlet abyss
#

There could be a library change here where it's compiled to lower-level syntax, or you could change your tsconfig.json to allow this.

#

@spare pelican What's your tsconfig.json look like? Not the one in the convex directory, the one in the project root.

spare pelican
#

Ahh okay!

// ./tsconfig.json
{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "strict": true,
    "target": "ES2015",
    "downlevelIteration": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "skipLibCheck": true,
    "baseUrl": ".",
    "paths": {
      "@db-service/*": ["packages/db-service/src/*"]
    }
  },
  "include": ["packages/**/*"],
  "exclude": ["node_modules", "packages/**/node_modules"]
}
#

Thanks for the quick response, tryna get the project pushed up on vercel right now for my colleague to use haha, so it's appriciated

scarlet abyss
#

the error says

with a '--target' of 'es2015' or higher.
and your target is "ES2015", so it seems like there's typechecking going on that doesn't use this tsconfig.json.

#

also you've got "downlevelIteration": true, right there

spare pelican
#

I have individual tsconfigs in each app:

// /apps/next-app
{
  "extends": "../../tsconfig.json",
  "compilerOptions": {
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "target": "ES2015",
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "downlevelIteration": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

scarlet abyss
#

We're doing a pass on convex-helpers patterns soon, so the convex-helpers side of this may be resolved soon — but there's something interesting about Next here where it typechecks using a different config than the one provided

spare pelican
#

Maybe that's the issue. But i'll try the quick unblock fix for now

scarlet abyss
#

I'd love to understand what tsconfig.json settings are being used for this typecheck that's blocking your build

#

since that error message doesn't make sense given the settings of either of the tsconfig.json files you've shown

spare pelican
#

I'm glad i'm not the only one thinking it doesn't make sense.

spare pelican
#

I wouldn't mind adding you to the full repo, in case you wanna take a look. but at the same time def, don't wanna steal your time. I'm assuming this aint really that convex related anyways. But give me a shout and i will.

spare pelican
#

Alright, seem's to have been the moduleResolution, was set to node. Changed it to bundler, and now it works. I might have actullay changed that to node at one point, since it solves some issues i was having with intellisense, but seems those are gone too even changing it back to bundler.