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

devserver proxy to grafana crashs #12664

Closed
7 tasks done
rawbin- opened this issue Mar 30, 2023 · 7 comments · Fixed by #12829
Closed
7 tasks done

devserver proxy to grafana crashs #12664

rawbin- opened this issue Mar 30, 2023 · 7 comments · Fixed by #12829

Comments

@rawbin-
Copy link
Contributor

rawbin- commented Mar 30, 2023

Describe the bug

normally proxy to grafana without crash

Reproduction

tring to create the demo

Steps to reproduce

1、run dev server
2、proxy the /grafana prefix to the grafana server
3、open a page with a iframe whose src is a /grafana/xxx/dashboard address
4、and the dev server crashes every time when I open the page, with the following error, everything goes well except this one

VITE v4.0.4 ready in 711 ms

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
node:events:490
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -54,
code: 'ECONNRESET',
syscall: 'read'
}

System Info

System:
    OS: macOS 13.3
    CPU: (8) arm64 Apple M1 Pro
    Memory: 64.16 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.8.1 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - ~/Library/pnpm/yarn
    npm: 9.5.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 111.0.5563.146
    Chrome Canary: 114.0.5684.0
    Firefox: 111.0
    Safari: 16.4
  npmPackages:
    @vitejs/plugin-react: ^3.0.0 => 3.0.0
    vite: ^4.0.4 => 4.0.4

Used Package Manager

npm

Logs

No response

Validations

@Tanimodori
Copy link

Tanimodori commented Mar 30, 2023

Have you tried the latest version of vite? Vite catches websocket error from proxy since 4.1.3 iirc. See #11991 #12007

@rawbin-
Copy link
Contributor Author

rawbin- commented Mar 31, 2023

same error on v4.2.1 and latest beta

Have you tried the latest version of vite? Vite catches websocket error from proxy since 4.1.3 iirc. See #11991 #12007

VITE v4.2.1 ready in 1277 ms

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
node:events:490
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -54,
code: 'ECONNRESET',
syscall: 'read'
}

Node.js v19.8.1
 ELIFECYCLE  Command failed with exit code 1.

VITE v4.3.0-beta.1 ready in 1082 ms

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
node:events:490
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on Socket instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -54,
code: 'ECONNRESET',
syscall: 'read'
}

Node.js v19.8.1

@rawbin-
Copy link
Contributor Author

rawbin- commented Mar 31, 2023

It works fine even on v4.0.4 when I comment // ws:true leaving the ws request pending. It looks like a new websocket proxy problem for all the versions above.

@Tanimodori
Copy link

The error seems identical to issue #11991, was the fix failed to fix that issue or there's more problems here? Have we verified that #11991 has been fixed?

@rawbin-
Copy link
Contributor Author

rawbin- commented Apr 3, 2023

The error seems identical to issue #11991, was the fix failed to fix that issue or there's more problems here? Have we verified that #11991 has been fixed?

#11991 does not come across to me ,so I am not sure

@github-actions
Copy link

github-actions bot commented Apr 3, 2023

Hello @rawbin-. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
@rawbin-
Copy link
Contributor Author

rawbin- commented Apr 11, 2023

refer to this issue http-party/node-http-proxy#1468

rawbin- pushed a commit to rawbin-/vite that referenced this issue Apr 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants