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

Webpack-Dev-Server uses the port of the dev server regardless of where the content was served from #1532

Open
rschristian opened this issue Feb 6, 2021 · 4 comments

Comments

@rschristian
Copy link
Member

rschristian commented Feb 6, 2021

Do you want to request a feature or report a bug?

Bug

What is the current behaviour?

Currently Webpack-Dev-Server will not necessarily use the correct port when making requests to the dev server. It will instead assume the port that the dev server is running upon.

This becomes a problem when used with items like Ngrok. Ngrok offers a way to create HTTP tunnels. You can make localhost:3000 accessible to the world via https://public.url.

The issue is that, while all content can be correctly served and the site usable, Dev Server will attempt to communicate with https://public.url:<dev server port number>. It needs to instead use the port number from the current address.

Probably a simple case of ensuring the plugin doesn't assume a port.

Not yet familiar enough with Prefresh to say whether it's an issue for this repo or its, so leaving this here while I investigate.

What is the expected behaviour?

That the request from the Dev Server goes to the correct address

@JoviDeCroock
Copy link
Member

I don't think that is an issue with prefresh as much as it is an issue with how the web-dev-server/hot-plugin is injected, a different port should be reflected on that I'd think.

@rschristian
Copy link
Member Author

Fair enough, I currently know probably next to nothing about what Prefresh is actually doing, so I just took a guess before investigating further. Certainly will look at those then.

@JoviDeCroock
Copy link
Member

I guess a good entry point would be to check whether or not normal hot-mode works i.e. if signals reach the client and if normal preact dev full reload mode works

@rschristian rschristian changed the title Prefresh uses the port of the dev server regardless of where the content was served from Webpack-Dev-Server uses the port of the dev server regardless of where the content was served from Feb 7, 2021
@rschristian
Copy link
Member Author

This looks to be a famously challenging problem (now that I've been pointed in the right direction, sorry Prefresh!), so a solution probably isn't going to be pleasant, just in case anyone else runs into this.

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

2 participants