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

點擊 “Modify the current session configuration ” 按鈕後整個網頁沒有反應

Open azhenge opened this issue 10 months ago • 4 comments

點擊 “Modify the current session configuration ” 按鈕後整個網頁沒有反應 控制檯日誌:

ERROR (node:4593) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created)

Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null } Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null } Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null } Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null }

ERROR Error fetching instructions: Invalid prisma.instruction.findMany() invocation in /Users/bobo/workspace/github/chat-ollama/server/api/instruction/index.get.ts:6:1

3 4 const listInstructions = async (): Promise<Instruction[] | null> => { 5 try { → 6 return await prisma.instruction.findMany( error: Environment variable not found: DATABASE_URL. --> schema.prisma:3 | 2 | provider = "sqlite" 3 | url = env("DATABASE_URL") |

Validation Error Count: 1

Invalid prisma.instruction.findMany() invocation in server/api/instruction/index.get.ts:6:1

3 4 const listInstructions = async (): Promise<Instruction[] | null> => { 5 try { → 6 return await prisma.instruction.findMany( error: Environment variable not found: DATABASE_URL. --> schema.prisma:3 | 2 | provider = "sqlite" 3 | url = env("DATABASE_URL") |

Validation Error Count: 1 at In.handleRequestError (node_modules/@prisma/client/runtime/library.js:122:7154) at In.handleAndLogRequestError (node_modules/@prisma/client/runtime/library.js:122:6188) at In.request (node_modules/@prisma/client/runtime/library.js:122:5896) at async l (node_modules/@prisma/client/runtime/library.js:127:11167) at listInstructions (server/api/instruction/index.get.ts:6:1) at Object.handler (server/api/instruction/index.get.ts:18:1) at async node_modules/h3/dist/index.mjs:1962:19 at async Object.callAsync (node_modules/unctx/dist/index.mjs:72:16) at async Server.toNodeHandle (node_modules/h3/dist/index.mjs:2249:7)

azhenge avatar Apr 20 '24 05:04 azhenge

这个似乎是 数据库没有成功初始化导致的

satrong avatar Apr 20 '24 05:04 satrong

重新下载了源码,已经通过npm 重新安装了,sqlite该如何处理呢?

azhenge avatar Apr 20 '24 14:04 azhenge

请问你有没有按照文档操作?

https://github.com/sugarforever/chat-ollama?tab=readme-ov-file#use-with-nuxt-3-development-server

satrong avatar Apr 21 '24 00:04 satrong

點擊 “Modify the current session configuration ” 按鈕後整個網頁沒有反應 控制檯日誌:

ERROR (node:4593) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created)

Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null } Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null } Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null } Ollama: { host: 'http://127.0.0.1:11434', username: null, password: null }

ERROR Error fetching instructions: Invalid prisma.instruction.findMany() invocation in /Users/bobo/workspace/github/chat-ollama/server/api/instruction/index.get.ts:6:1

3 4 const listInstructions = async (): Promise<Instruction[] | null> => { 5 try { → 6 return await prisma.instruction.findMany( error: Environment variable not found: DATABASE_URL. --> schema.prisma:3 | 2 | provider = "sqlite" 3 | url = env("DATABASE_URL") |

Validation Error Count: 1

Invalid prisma.instruction.findMany() invocation in server/api/instruction/index.get.ts:6:1

3 4 const listInstructions = async (): Promise<Instruction[] | null> => { 5 try { → 6 return await prisma.instruction.findMany( error: Environment variable not found: DATABASE_URL. --> schema.prisma:3 | 2 | provider = "sqlite" 3 | url = env("DATABASE_URL") |

Validation Error Count: 1 at In.handleRequestError (node_modules/@prisma/client/runtime/library.js:122:7154) at In.handleAndLogRequestError (node_modules/@prisma/client/runtime/library.js:122:6188) at In.request (node_modules/@prisma/client/runtime/library.js:122:5896) at async l (node_modules/@prisma/client/runtime/library.js:127:11167) at listInstructions (server/api/instruction/index.get.ts:6:1) at Object.handler (server/api/instruction/index.get.ts:18:1) at async node_modules/h3/dist/index.mjs:1962:19 at async Object.callAsync (node_modules/unctx/dist/index.mjs:72:16) at async Server.toNodeHandle (node_modules/h3/dist/index.mjs:2249:7)

看起来是运行的开发服务器吧。

请确认:

  1. .env 或环境变量里是否有设置DATABASE_URL
  2. 是否有创建SQLite数据库,比如运行pnpm run prisma-migrate

sugarforever avatar Apr 21 '24 00:04 sugarforever

请问你有没有按照文档操作?

https://github.com/sugarforever/chat-ollama?tab=readme-ov-file#use-with-nuxt-3-development-server

image

明白了,少了這一步。如果啓動時有關鍵項自檢日誌就好了

azhenge avatar Apr 22 '24 02:04 azhenge