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

[Bug]: warning failed to get stats with lazyCompilation in dev mode #8503

Open
bigbossx opened this issue Nov 21, 2024 · 8 comments
Open

[Bug]: warning failed to get stats with lazyCompilation in dev mode #8503

bigbossx opened this issue Nov 21, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@bigbossx
Copy link

System Info

Image

Details

when i use rsbuild v1.0.19 with lazyCompilation mode.

the browser will show hmr connect and reload, and wait compilation done

But in v1.1.4 the browser will remain on the white page unless you refresh the page manually. it's a bad dev experience

Reproduce link

No response

Reproduce Steps

export default defineConfig({
  dev: {
    progressBar: true,
    lazyCompilation: true
  },
})
rsbuild dev
@bigbossx bigbossx added bug Something isn't working pending triage The issue/PR is currently untouched. labels Nov 21, 2024
@JSerFeng JSerFeng self-assigned this Nov 25, 2024
@JSerFeng
Copy link
Collaborator

Can you provide a minimal repro ? If so I can fix this in maybe several days

@chenjiahan chenjiahan removed the pending triage The issue/PR is currently untouched. label Nov 25, 2024
@bigbossx
Copy link
Author

bigbossx commented Nov 25, 2024

@JSerFeng here.

finally I find that I was using an https domain name proxy for development instead of localhost.

  • if i use localhost, everything work find

  • but for avoid cors limited I dev with Whistle
    Image

you can also reproduce in here

I think maybe eventSource or http-server broken in lazyCompilation mode when we use domain proxy

please let me know if it still need more info

@JSerFeng
Copy link
Collaborator

lazy-compilation has no idea of dev-server proxy, I'm thinking we should implement lazy compilation by a normal middleware instead of eventSource, I'll fix this later, thanks for investigating

@bigbossx
Copy link
Author

@JSerFeng Thanks for your quick reply.
btw, it only happen when i use 1.1.x. everything worked when i use 1.0.x

@JSerFeng
Copy link
Collaborator

That's wired, lazy compilation almost has nothing changes since 1.0

@bigbossx
Copy link
Author

That's weird.

you can compare branches main(v1.0.19) and bug-lazy(v1.1.4)

@JSerFeng
Copy link
Collaborator

Since you are using system proxy, can you try to get DevServer instance ? If so, you can pass it to lazyCompilation configuration like:

{
  lazyCompilation: {
    backEnd: { server: () => server /*your server instance*/ }
  }  
}

This might solve it

@bigbossx
Copy link
Author

@JSerFeng

I think I misled you. I made a wrong judgment. the problem is not that I am using a domain name proxy, but there will be problems with IP access.

you can try reproduce it

when i visit with localhost
Image

when i visit with ip
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants