lanthe
lanthe•15mo ago

Netlify deploy build errors

I'm trying to deploy via Netlify and I'm getting build errors. At first I was getting this error: https://github.com/vitejs/vite/issues/15714 I updated vite to 5.1.5 and now I'm getting this instead: "node_modules/vite/dist/node/index.d.ts(5,41): error TS2307: Cannot find module "rollup/parseAst" or its corresponding type declarations." The internet's advice on this error appears to be to downgrade vite :/. Any thoughts?
12 Replies
sshader
sshader•15mo ago
šŸ‘‹ One thing to try is setting the moduleResolution to "Bundler" in the tsconfig.json (https://github.com/vitejs/vite/discussions/12466#discussioncomment-7596971) Another thing to try is setting skipLibCheck: true in the tsconfig.json (this effectively tells TypeScript not to try type checking most of your node modules, which works around this error) And then lastly, --typecheck disable with Convex commands will skip typechecking altogether, but at least let you deploy your convex code
GitHub
Vite 5 Ā· vitejs vite Ā· Discussion #12466
We're starting a discussion to gather early feedback from the downstream ecosystem and users about their needs for Vite's next Major. Before commenting, please review current open issues an...
lanthe
lantheOP•15mo ago
I had already tried Bundler unsuccessfully, and skipLibCheck was true by default, but I guess I'll --typecheck disable
sshader
sshader•15mo ago
Just to check -- do you have multiple tsconfig.jsons that might need updating? A semi-common set up with Convex is to have one at the top level and one in the convex directory
lanthe
lantheOP•15mo ago
i do! whoa. lemme try that skipLibCheck: true at the top level seems to have worked i don't really understnad why... the error doesn't look like a type error to me
sshader
sshader•15mo ago
Seeing ".d.ts" and "or its corresponding type declarations" made me think this is a type error (plus running into some similar things trying to update some internal convex apps to use a newer version of vite)
lanthe
lantheOP•15mo ago
well!! thanks so much
erquhart
erquhart•12mo ago
@sshader I just ran into this once I added convex-test, may be worth adding skipLibCheck config to the install instructions for that. I only needed to add it to the convex tsconfig. Or maybe it should just go into the default convex tsconfig, I don't think there are negatives to that (but not certain)
Michal Srb
Michal Srb•12mo ago
@erquhart what error did you get? (can you repro if you revert the skipLibCheck?)
erquhart
erquhart•12mo ago
Same as OP, "node_modules/vite/dist/node/index.d.ts(5,41): error TS2307: Cannot find module "rollup/parseAst" or its corresponding type declarations." Hmm actually it was rollup/parseAst, but it was from Vitest, not Vite (I'm not using Vite) I'll get the exact message
āœ– TypeScript typecheck via `tsc` failed.
To ignore failing typecheck, use `--typecheck=disable`.
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.

5 export { parseAst, parseAstAsync } from 'rollup/parseAst';
~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/vitest/node_modules/vite/dist/node/index.d.ts:5
āœ– TypeScript typecheck via `tsc` failed.
To ignore failing typecheck, use `--typecheck=disable`.
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.

5 export { parseAst, parseAstAsync } from 'rollup/parseAst';
~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/vitest/node_modules/vite/dist/node/index.d.ts:5
I should probably be excluding it or something, not even sure why test dependencies would be in play here
Michal Srb
Michal Srb•12mo ago
Can you try first whether having moduleResolution: "bundler" in all your tsconfigs fixes the issue? (starting with convex/tsconfig.json if you have one)
erquhart
erquhart•12mo ago
Ah, that did it. Only changed the convex tsconfig, base config is still set to node.
Michal Srb
Michal Srb•12mo ago
We're working on changing the moduleResolution default to "bundler"

Did you find this page helpful?