-
Notifications
You must be signed in to change notification settings - Fork 29
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
Dev server not working on GitHub Codespaces #218
Comments
Thanks @Koenkk for the commitment you put into this issue. Would you like to find a solution to make it works? |
@gioboa yes but I would need some guidance on how a proper fix should look like, does adding a new config option for this make sense? |
The first step is to figure out how to solve this problem and make it works, you can hack the library and modify it directly. |
I already hacked it locally and then it works, made the following change (pseudo, because I modified the transpiled JS version): host = 'upgraded-journey-pg6jpg4vp539wr-5176.app.github.dev'
port = 443
const {init} = await import("//${host}:${port}${viteConfig.base + options.filename}") |
@gioboa that's what I already tried, but then Vite refuses to start, see the OP.
I think this should be a separate optional option, and in case it's not specified use the Vite config. |
@Koenkk Let's try the separate option, make it work. then we can decide whether we need it or not. |
@gioboa sounds good! Will give it a shot. |
I'm trying to run the Vite Dev server with the vite-remote example on GitHub Codespaces but it doesn't work. This issue is not limited to GitHub Codespaces, it fails whenever the dev server is not reachable on
localhost
(which is also the case when you run the dev server behind a reverse proxy, Coder or GitLab workspaces).Issue
The issue is that it tries to load
remoteEntry-[hash].js
fromlocalhost:5173
which is both the wrong hostname and port. For the example below, it should have usedhttps://upgraded-journey-pg6jpg4vp539wr-5176.app.github.dev:443/testbase/remoteEntry-[hash].js
.Steps to reproduce
cd vite-remote pnpm i --frozen-lockfile pnpm run dev
Analysis
I did some analysis on why this occurs. I believe the code below should allow specifying a different host and port (hacking this manually
in the
node_modules
folder fixes the issue)vite/src/plugins/pluginProxyRemoteEntry.ts
Line 60 in aaa23f5
Alternatively, I tried changing the Vite config as follows but then
pnpm run dev
doesn't work:server: { open: true, port: 5176, + host: 'upgraded-journey-pg6jpg4vp539wr-5176.app.github.dev', origin: 'http://localhost:5176', },
The text was updated successfully, but these errors were encountered: