chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

npm run error (latest git pull)

Open shuther opened this issue 2 years ago • 2 comments

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)

shuther avatar Dec 07 '23 10:12 shuther

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?

nsarrazin avatar Dec 07 '23 11:12 nsarrazin

node --version v21.3.0

shuther avatar Dec 08 '23 11:12 shuther

Validate the mongo instance is running

jaysonfrancis avatar Mar 26 '24 20:03 jaysonfrancis

issue has been fixed with new version

shuther avatar Apr 24 '24 12:04 shuther