Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地跑前端项目显示接口报错,但已经配好了反向代理,求解 #423

Closed
5 tasks done
CathLee opened this issue Aug 11, 2024 · 4 comments
Closed
5 tasks done

Comments

@CathLee
Copy link

CathLee commented Aug 11, 2024

Describe the bug

⨯ FetchError: [GET] "https://cathylee.xyz/api/v2/aggregate?theme=shiro": fetch failed
at async fetcher (api.tsx:24:31)
digest: "1733242172"
Cause: TypeError: fetch failed
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async $fetchRaw2 (webpack-internal:///(rsc)/./node_modules/.pnpm/ofetch@1.3.4/node_modules/ofetch/dist/shared/ofetch.37386b05.mjs:230:26)
at async $fetch2 (webpack-internal:///(rsc)/./node_modules/.pnpm/ofetch@1.3.4/node_modules/ofetch/dist/shared/ofetch.37386b05.mjs:276:15)
at async fetcher (webpack-internal:///(rsc)/./src/app/(app)/api.tsx:24:31) {
cause: Error: read ECONNRESET
at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}
}

Reproduction

dev

System Info

pnpm run dev

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@CathLee
Copy link
Author

CathLee commented Aug 11, 2024

屏幕截图 2024-08-11 172844
这个是我的后端反向代理。而且还有一个神奇的现象,就是连上梯子之后,https://cathylee.xyz/api/v2都打不开,不知道是不是因为服务器是国内的腾讯云的问题(菜鸡托腮

@jiuyue52
Copy link

前端有配https没

@CathLee
Copy link
Author

CathLee commented Aug 11, 2024

不太清除前端配https,具体是指什么情况(小白勿怪
后端域名是有配好ssl和强制https的
屏幕截图 2024-08-11 190359

issue里的报错是我本地localhost:2323的页面,不太清楚和配置https是否有关系
屏幕截图 2024-08-11 190800
要是有大佬解答就好了(•_•)

前端有配https没

@suemor233
Copy link
Collaborator

https://cathylee.xyz/api/v2/aggregate?theme=shiro

要在本地运行的话,后端 docker-compose.yml ALLOWED_ORIGINS 里需要加上 localhost:*,127.0.0.1:*

@CathLee CathLee closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants