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

allow connection to hmr server locally #797

Closed
wants to merge 1 commit into from
Closed

Conversation

sys13
Copy link
Contributor

@sys13 sys13 commented Jul 15, 2024

Vite's hot module reload server is on this port. This opens the CSP to connect to it in dev.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! The CSP is set to report only, so it shouldn't affect functionality and I've not personally seen any CSP warnings either. Can you screenshot your console with warnings?

Also, I'm concerned about hard coding the port.

@@ -115,7 +115,7 @@ app.use(
reportOnly: true,
directives: {
'connect-src': [
MODE === 'development' ? 'ws:' : null,
...(MODE === 'development' ? ['ws:', 'localhost:24678'] : []),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other way for us to determine this websocket address? The problem is, what happens if I try to run my app two times at once?

@sys13 sys13 closed this Aug 3, 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

Successfully merging this pull request may close these issues.

2 participants