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?
GitHub
type error | Type 'FSWatcher' is missing the following properties f...
Describe the bug clone repo and npm install && npm run ci current status: https://github.com/mhf-ir/Node.js-TypeScript-Starter/actions/runs/7658137582/job/20870418679 Error: node_modules/vi...
12 Replies
š 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 codeGitHub
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...
I had already tried Bundler unsuccessfully, and skipLibCheck was true by default, but I guess I'll --typecheck disable
Just to check -- do you have multiple
tsconfig.json
s that might need updating? A semi-common set up with Convex is to have one at the top level and one in the convex
directoryi 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
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)
well!! thanks so much
@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)@erquhart what error did you get? (can you repro if you revert the skipLibCheck?)
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
I should probably be excluding it or something, not even sure why test dependencies would be in play here
Can you try first whether having
moduleResolution: "bundler"
in all your tsconfigs fixes the issue?
(starting with convex/tsconfig.json
if you have one)Ah, that did it. Only changed the convex tsconfig, base config is still set to node.
We're working on changing the moduleResolution default to
"bundler"