#`Cannot find module 'rollup/parseAst' or its corresponding type declarations.`

17 messages · Page 1 of 1 (latest)

cunning saffron
#

I just upgraded from Convex 1.5.1 to 1.6.3 and I'm now getting the following error when running convex dev:

 ✖ TypeScript typecheck via `tsc` failed.
 To ignore failing typecheck, use `--typecheck=disable`.
 - Collecting TypeScript errors
 
 node_modules/vite/dist/node/index.d.ts:6:41 - error TS2307: Cannot find module 'rollup/parseAst' or its corresponding type declarations.
 
 6 export { parseAst, parseAstAsync } from 'rollup/parseAst';
                                           ~~~~~~~~~~~~~~~~~
 
 Found 1 error in node_modules/vite/dist/node/index.d.ts:6

Any clue why this might be/how to resolve it?

haughty jackal
#

looks like this is the Convex typecheck trying to find rollup. I wonder why it wants this. Is this the only change? I'll look through our changes.

#

Would you try

  • doing a push skipping the typecheck: does that work?
  • running npx tsc --project convex --explainFiles and looking how Vite gets in here
#

hm I dont' see anything that I can imagine affecting this

cunning saffron
#

Pushing without typechecking appears to succeed

haughty jackal
#

of the three suggested fixes, I know skipLibCheck: true in the convex/tsconfig.json would work. moduleResolution: 'bundler' is the "right" one to use I think, but it would be a bigger change.

cunning saffron
#

Hmm, vite isn't a direct dependency of my project, but I had also updated Remix from 2.3.x to 2.4.0, and I know they have integration with Vite as beta feature in v2, so perhaps that also led to Vite being upgraded?

#

(as a dependency of Remix)

haughty jackal
#

hm I see Support Vite 5 (#7846) in Remix 2.3, nothing quite sounds relevant in 2.4

#

if node_modules/vite/package.json says 5 this sounds lke this issue, we see enough libraries that suggest skipLibCheck: true as the workaround that we don't rely on it working correctly

cunning saffron
#

npm why vite produces:

[email protected] dev
node_modules/vite
  peerOptional vite@"^5.0.0" from @remix-run/[email protected]
  node_modules/@remix-run/dev
    dev @remix-run/dev@"2.4.0" from the root project
  vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0" from [email protected]
  node_modules/vitest
    dev vitest@"0.34.6" from the root project
  vite@"^3.0.0 || ^4.0.0 || ^5.0.0-0" from [email protected]
  node_modules/vitest/node_modules/vite-node
    vite-node@"0.34.6" from [email protected]
    node_modules/vitest
      dev vitest@"0.34.6" from the root project

[email protected] dev
node_modules/vite-node/node_modules/vite
  vite@"^3.0.0 || ^4.0.0" from [email protected]
  node_modules/vite-node
    vite-node@"^0.28.5" from @vanilla-extract/[email protected]
    node_modules/@vanilla-extract/integration
      @vanilla-extract/integration@"^6.2.0" from @remix-run/[email protected]
      node_modules/@remix-run/dev
        dev @remix-run/dev@"2.4.0" from the root project

[email protected] dev
node_modules/@vanilla-extract/integration/node_modules/vite
  vite@"^4.1.4" from @vanilla-extract/[email protected]
  node_modules/@vanilla-extract/integration
    @vanilla-extract/integration@"^6.2.0" from @remix-run/[email protected]
    node_modules/@remix-run/dev
      dev @remix-run/dev@"2.4.0" from the root project
cunning saffron
#

Is there any reason I shouldn't go with that?

haughty jackal
#

That's great, that's we'd like to move to. It's a large change from "moduleResolution": "node" because it means now TypeScript actually uses exports field in package.json to locate types when traversing dependencies, so it's possible one of your other dependencies would have this broken.

cunning saffron
#

Ah, I see!

#

Good thing I only allow the finest dependencies into my Convex codebase 🥂