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

HMR in Gitpod + VS Code Browser #21341

Closed
MehrdadKhnzd opened this issue Jun 3, 2023 · 6 comments
Closed

HMR in Gitpod + VS Code Browser #21341

MehrdadKhnzd opened this issue Jun 3, 2023 · 6 comments

Comments

@MehrdadKhnzd
Copy link

Hi,

I'm having a hard time fixing HMR while developing on Gitpod using VS Code Browser.
Apparently, it's working on Vite normally, but it doesn't with Nuxt.
I tried everything I found online, but it seems I'm stuck in a chicken-and-egg problem.

Please refer to this URL for the context:
https://www.gitpod.io/docs/introduction/languages/javascript#vite

Any ideas on what can be the problem and how to make it work in Nuxt?
I can let you know the specific behavior of specific settings if it helps.

Thanks!

@ghostdevv
Copy link

Nuxt is trying to connect over a different port (24678) than the one that the http server is on (3000), which isn't working here because of how Gitpod handles port connections (https://PORT-WORKSPACE.... instead of https://DOMAIN:PORT)

I remember when Vite 3 fixed this but never pin pointed the exact change that caused it, wonder if anyone from the nuxt team/community has any ideas

image

@ghostdevv
Copy link

Nuxt seems to be using the 24678 port here, from what I can tell the behaviour in vite is to use the clientPort which would be 3000 here and if that isn't defined use 24678 - I think the behaviour there should be replicated into nuxt? If the extra code is needed at all

@ghostdevv
Copy link

I think it may be this pr that fixed the issue in vite 3 - by doing the behaviour described in my above comment (hmr over the server port - i.e. 3000 in nuxt)

@MehrdadKhnzd
Copy link
Author

Any updates on this?

@MehrdadKhnzd
Copy link
Author

#23206 Finally fixed the issue. Thanks!

@ghostdevv
Copy link

Amazing!

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

Successfully merging a pull request may close this issue.

3 participants