huggingface / chat-ui

Open source codebase powering the HuggingChat app
https://huggingface.co/chat
Apache License 2.0
7.29k stars 1.06k forks source link

npm run error (latest git pull) #615

Closed shuther closed 5 months ago

shuther commented 9 months ago

I created a .env.local as:

MONGODB_URL=mongodb://localhost:27017
MONGODB_DB_NAME=chat-ui
MONGODB_DIRECT_CONNECTION=false

COOKIE_NAME=hf-chat
HF_TOKEN=
HF_API_ROOT=https://api-inference.huggingface.co/models
OPENAI_API_KEY=

Then I tried:

npm install #everything went fine
npm run dev -- --host 0.0.0.0

but I got the error below:

(node:770942) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
11:47:42 AM [vite] Error when evaluating SSR module /src/lib/server/auth.ts:
|- SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at /home/shuther/devProjects/chat-ui/src/lib/server/auth.ts:43:14
    at async instantiateModule (file:///home/shuther/devProjects/chat-ui/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:54405:9)

11:47:42 AM [vite] Error when evaluating SSR module /src/hooks.server.ts: failed to import "/src/lib/server/auth.ts"
|- SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at /home/shuther/devProjects/chat-ui/src/lib/server/auth.ts:43:14
    at async instantiateModule (file:///home/shuther/devProjects/chat-ui/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:54405:9)

SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at /home/shuther/devProjects/chat-ui/src/lib/server/auth.ts:43:14
    at async instantiateModule (file:///home/shuther/devProjects/chat-ui/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:54405:9)
SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at /home/shuther/devProjects/chat-ui/src/lib/server/auth.ts:43:14
    at async instantiateModule (file:///home/shuther/devProjects/chat-ui/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:54405:9)

On the browser side, I have error 500 (nice picture)

nsarrazin commented 9 months ago

Not sure why that would be the case :eyes: I don't recognize this warning here

(node:770942) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Does this ring a bell to you?

Can you show me your node --version as well?

shuther commented 9 months ago

node --version v21.3.0

jaysonfrancis commented 6 months ago

Validate the mongo instance is running

shuther commented 5 months ago

issue has been fixed with new version