wasp: tsconfig.json(2,14): error TS6053: File '@tsconfig/node18/tsconfig.json' not found

Hi -

I’m trying to start a new wasp project but running into this error on wasp db migrate-dev command.

Do you know what the issue could be?

✅ — Database successfully set up. ----------------------------------------------

🐝 — Building SDK… ------------------------------------------------------------

[ Wasp ] tsconfig.json(2,14): error TS6053: File ‘@tsconfig/node18/tsconfig.json’ not found. [ Wasp ] …/…/…/…/node_modules/@testing-library/jest-dom/types/jest.d.ts(1,23): error TS2688: Cannot find type definition file for ‘jest’. [ Wasp ] …/…/…/…/node_modules/@testing-library/jest-dom/types/jest.d.ts(9,27): error TS2304: Cannot find name ‘expect’. [ Wasp ] …/…/…/…/node_modules/vitest/node_modules/vite/dist/node/index.d.ts(5,41): error TS2307: Cannot find module ‘rollup/parseAst’ or its corresponding type declarations. [ Wasp ] There are types at ‘…/mySaasApp/node_modules/vitest/node_modules/rollup/dist/parseAst.d.ts’, but this result could not be resolved under your current ‘moduleResolution’ setting. Consider updating to ‘node16’, ‘nodenext’, or ‘bundler’.

❌ — [Error] Your wasp project failed to compile: -------------------------------

  • SDK build failed with exit code: 2

❌ — [Error] Compilation of wasp project failed: --------------------------------

1 errors found

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 43 (32 by maintainers)

Most upvoted comments

One more report: https://discord.com/channels/686873244791210014/1250815248395669504/1250815248395669504 .

User was using node 18, but new data point is that they managed to fix it by adding

 "devDependencies": {
    "@tsconfig/node18": "latest",

to their package.json.

What also worked was switching to node 20, then that dev dependency was not needed, same like other users.

@grsh50 , could you please try switching to node 20 (e.g. using nvm) and try running Wasp again?

@aliammari1 which node version are you using? If you are using 18, could you also try switching to 20 and tell us if that helps?

It seems to be related to ts-node which jest uses under the hood to resolve the tsconfig.json.

That’s not it (at least I think it isn’t). ts-node is nowhere to be found in node_modules. From what I see, Jest isn’t using it.

@infomiho What made you think we were using ts-node? If it was this comment, it was probably a misunderstanding - the comment talks about Jest TS configuration files (not tsconfig.json files).

Regardless, I tried installing ts-node both globally and in the repo, with the hopes of jest using it if it’s available, but no luck. Unless I missed something, I think it’s safe to say this isn’t related to ts-node.

I’ll now try reproducing it with different versions of TypeScript.

I ran some test builds with todo's and saas templates on node versions 18.19.0 and 18.19.1 and everything works fine.

Ah come on 😃! I am kidding, thanks a lot, but am still surprised by inconsistency of this bug. Still, we will figure it out, one way or another!