Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

error when click login button #137

Open
xqyi opened this issue May 8, 2023 · 4 comments
Open

error when click login button #137

xqyi opened this issue May 8, 2023 · 4 comments

Comments

@xqyi
Copy link

xqyi commented May 8, 2023

Describe the bug
error when click ChatGPT Login button:
image

To Reproduce
Steps to reproduce the behavior:

  1. git clone the source code
  2. npm i
  3. npm run dev (started on localhost:3000)
  4. open localhost:3000 in microsoft edge
  5. click prompt button
  6. enter openai key in textbox and click login button, then get error message

click-prompt:dev: click-prompt:dev: Import trace for requested module: click-prompt:dev: ../../node_modules/node-fetch/lib/index.js click-prompt:dev: ./src/api/user.ts click-prompt:dev: ./src/components/ClickPrompt/ClickPromptButton.tsx click-prompt:dev: No secret key env in the server. click-prompt:dev: error - TypeError: fetch failed click-prompt:dev: at Object.fetch (node:internal/deps/undici/undici:11413:11) click-prompt:dev: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { click-prompt:dev: cause: Error: getaddrinfo ENOTFOUND undefined click-prompt:dev: at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) click-prompt:dev: at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) { click-prompt:dev: errno: -3008, click-prompt:dev: code: 'ENOTFOUND', click-prompt:dev: syscall: 'getaddrinfo', click-prompt:dev: hostname: 'undefined' click-prompt:dev: }, click-prompt:dev: page: '/api/chatgpt/user' click-prompt:dev: } click-prompt:dev: warn - ../../node_modules/node-fetch/lib/index.js click-prompt:dev: Module not found: Can't resolve 'encoding' in 'C:\Users\xqyi\click-prompt\node_modules\node-fetch\lib' click-prompt:dev: click-prompt:dev: Import trace for requested module: click-prompt:dev: ../../node_modules/node-fetch/lib/index.js click-prompt:dev: ./src/api/user.ts click-prompt:dev: wait - compiling /_error (client and server)... click-prompt:dev: ./src/components/ClickPrompt/ClickPromptButton.tsx click-prompt:dev: warn - ../../node_modules/node-fetch/lib/index.js click-prompt:dev: Module not found: Can't resolve 'encoding' in 'C:\Users\xqyi\click-prompt\node_modules\node-fetch\lib' click-prompt:dev: click-prompt:dev: Import trace for requested module: click-prompt:dev: ../../node_modules/node-fetch/lib/index.js click-prompt:dev: ./src/api/user.ts click-prompt:dev: ./src/components/ClickPrompt/ClickPromptButton.tsx

@xqyi
Copy link
Author

xqyi commented May 8, 2023

image

@zhaoqf-cq
Copy link

Did you solve it? I'm using the dev branch and encountering the same issue on Windows 11.

click-prompt:dev: Import trace for requested module:
click-prompt:dev: ../../node_modules/node-fetch/lib/index.js
click-prompt:dev: ./src/api/user.ts
click-prompt:dev: ./src/components/ClickPrompt/ClickPromptButton.tsx
click-prompt:dev: No secret key env in the server.
click-prompt:dev: error - TypeError: fetch failed
click-prompt:dev:     at Object.fetch (node:internal/deps/undici/undici:11457:11)
click-prompt:dev:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
click-prompt:dev:     at async postJSON (webpack-internal:///(api)/../../node_modules/@planetscale/database/dist/index.js:128:22)
click-prompt:dev:     at async Connection.execute (webpack-internal:///(api)/../../node_modules/@planetscale/database/dist/index.js:88:23)
click-prompt:dev:     at async _PlanetScaleConnection.executeQuery (webpack-internal:///(api)/../../node_modules/kysely-planetscale/dist/index.js:96:21)
click-prompt:dev:     at async C:\tmp\click-prompt\node_modules\kysely\dist\cjs\query-executor\query-executor-base.js:37:28
click-prompt:dev:     at async DefaultConnectionProvider.provideConnection (C:\tmp\click-prompt\node_modules\kysely\dist\cjs\driver\default-connection-provider.js:12:20)
click-prompt:dev:     at async DefaultQueryExecutor.executeQuery (C:\tmp\click-prompt\node_modules\kysely\dist\cjs\query-executor\query-executor-base.js:36:16)
click-prompt:dev:     at async SelectQueryBuilder.execute (C:\tmp\click-prompt\node_modules\kysely\dist\cjs\query-builder\select-query-builder.js:889:24)
click-prompt:dev:     at async handler (webpack-internal:///(api)/./src/pages/api/chatgpt/user.ts:30:22)
click-prompt:dev:     at async Object.apiResolver (C:\tmp\click-prompt\node_modules\next\dist\server\api-utils\node.js:372:9)
click-prompt:dev:     at async DevServer.runApi (C:\tmp\click-prompt\node_modules\next\dist\server\next-server.js:514:9)click-prompt:dev:     at async Object.fn (C:\tmp\click-prompt\node_modules\next\dist\server\next-server.js:828:35)
click-prompt:dev:     at async Router.execute (C:\tmp\click-prompt\node_modules\next\dist\server\router.js:243:32)
click-prompt:dev:     at async DevServer.runImpl (C:\tmp\click-prompt\node_modules\next\dist\server\base-server.js:432:29)
click-prompt:dev:     at async DevServer.run (C:\tmp\click-prompt\node_modules\next\dist\server\dev\next-dev-server.js:831:20)
click-prompt:dev:     at async DevServer.handleRequestImpl (C:\tmp\click-prompt\node_modules\next\dist\server\base-server.js:375:20)
click-prompt:dev:     at async C:\tmp\click-prompt\node_modules\next\dist\server\base-server.js:157:99 {
click-prompt:dev:   cause: Error: getaddrinfo ENOTFOUND undefined
click-prompt:dev:       at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)
click-prompt:dev:       at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
click-prompt:dev:     errno: -3008,
click-prompt:dev:     code: 'ENOTFOUND',
click-prompt:dev:     syscall: 'getaddrinfo',
click-prompt:dev:     hostname: 'undefined'
click-prompt:dev:   },
click-prompt:dev:   page: '/api/chatgpt/user'
click-prompt:dev: }
`

@Mingxiangyu
Copy link

image

+1

@Thinking80s
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants