#Functional local build not deploying on Vercel/Netlify

10 messages · Page 1 of 1 (latest)

cyan hemlock
#

Here's the project I am running: https://github.com/ianmacartney/streaming-chat-gpt

I successfully ran the project on my device (M1 MacOS) after running "npm install" and "npm run dev". I even got it working with the backend Convex DB running locally! I am, however, having issues deploying it to production. After following the Vercel/Netlify directions I got from: https://docs.convex.dev/production/hosting/ here is the error I'm facing:

node_modules/vite/dist/node/index.d.ts(843,22): error TS2420: Class 'import("/vercel/path0/node_modules/vite/dist/node/index").FSWatcher' incorrectly implements interface 'import("fs").FSWatcher'.
  Type 'FSWatcher' is missing the following properties from type 'FSWatcher': ref, unref
✖ 'npm run build' failed
Error: Command "npx convex deploy --cmd 'npm run build'" exited with 1

How would I best troubleshoot this so I can try deploying the website?

GitHub

An example of streaming ChatGPT via the OpenAI v4.0 node SDK. - ianmacartney/streaming-chat-gpt

Share your Convex backend and web app with the world.

atomic fossilBOT
#

Hi @cyan hemlock. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the error message you provided, it seems like there might be an issue with the vite package in your project. This error is not directly related to Convex, but rather to the Vite build tool you're using.

However, there's a similar issue discussed in one of the Discord threads from the knowledge sources. In that thread, a user was facing build errors while deploying on Netlify. The Trusted Support Staff suggested a few solutions:

  1. Setting the moduleResolution to "Bundler" in the tsconfig.json.
  2. 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.
  3. Using --typecheck disable with Convex commands to skip typechecking altogether, but at least let you deploy your convex code.

You can try these solutions to see if they resolve your issue. If you have multiple tsconfig.json files (for example, one at the top level and one in the convex directory), make sure to update all of them.

Here's the relevant extract from the knowledge source:

#
# Discord support thread: Netlify deploy build errors > Answers
**Trusted Support Staff 8**:👋 One thing to try is setting the `moduleResolution` to `&amp;quot;Bundler&amp;quot;` 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
**Community Member 292**:I had already tried Bundler unsuccessfully, and skipLibCheck was true by default, but I guess I&#x27;ll --typecheck disable
**Trusted Support Staff 8**: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` directory
**Community Member 292**:i do!  whoa.  lemme try that
**Community Member 292**:skipLibCheck: true at the top level seems to have worked
**Community Member 292**:i don&#x27;t really understnad why... the error doesn&#x27;t look like a type error to me
**Trusted Support Staff 8**:Seeing &quot;.d.ts&quot; and &quot;or its corresponding type declarations&quot; made me think this is a type error
**Trusted Support Staff 8**:(plus running into some similar things trying to update some internal convex apps to use a newer version of vite)
**Community Member 292**:well!! thanks so much

If these solutions don't work, you might want to look for help in the Vite community or the community of the specific package causing the error.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@cyan hemlock kapa.ai is still learning and improving, please let us know how it did by reacting below

zealous plank
#

@cyan hemlock that's great that you got this running with a local backend!

cyan hemlock
#

Runs great fully offline with the Convex local backend + local LLM, as well as a production website with (using TogetherAI as the provider) and my api key as an environment variable

#

Great template!