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]: Build in webpack + production mode stuck when rsdoctor is enabled. #206

Open
pushkargupta9807 opened this issue Mar 9, 2024 · 8 comments
Labels

Comments

@pushkargupta9807
Copy link

pushkargupta9807 commented Mar 9, 2024

Version

System:
    OS: macOS 14.3.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 8.01 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Edge: 122.0.2365.80
    Safari: 17.3.1

Details

Hello, I enabled the rsdoctor/webpack-plugin and triggered a webpack + production build.
I can see the live build-analysis ongoing along with the build. However, I do not see the build ever completing and seems like it is stuck forever.
FYI, I switched the features to [lite, loader, plugins] to avoid any OOM issues.
I also tried by disabling the disableClientServer , but still the build is stuck. I waited for ~2-3 hours for a build which typically takes around 15 minutes to complete.

Its stuck at "52.1% building" as shown in the below image:
image

Reproduce link

N/A

Reproduce Steps

enable @rsdoctor/webpack-plugin for a webpack build in production mode.

@pushkargupta9807 pushkargupta9807 added the 🐞 bug Something isn't working label Mar 9, 2024
@easy1090
Copy link
Collaborator

This problem may occur under the construction of super-large projects, because Loader reporting will increase the time. We have expected to rust under rspack next quarter to optimize this problem.

This problem seems to be that the compilation stage is relatively heavy, and a specific case needs to be provided. I don't know if it is convenient to provide it.

After the construction is completed, you can also use @rsdoctor/cli to open the report and provide the loader time-consuming data to see which loaders take more time.

@pushkargupta9807
Copy link
Author

pushkargupta9807 commented Mar 11, 2024

Thank @easy1090 . So is there a way I can create the html report file without enabling the devClientServer and just running the build end to end? If so can you lay out the steps please. Thanks

I have also disabled the clientServer which runs the report realtime .

const { RsdoctorWebpackPlugin } = require("@rsdoctor/webpack-plugin");
webpackConfig.plugins.push(
  new RsdoctorWebpackPlugin({
    disableClientServer: true,
    features: ["loader"],
  })
); 

and I have already set the NODE_OPTIONS: ' --max-old-space-size="65536"'

@easy1090
Copy link
Collaborator

easy1090 commented Mar 12, 2024

@pushkargupta9807

If the clientServer that runs the report in real-time is disabled, will the report also auto-open?

You can set disableClientServer to true to build without opening the report. After the build is completed, it will be in the build product directory .rsdoctor/manifest.json file. But when you want to open the report, you can use @rsdoctor/cli to open the report without building it: https://rsdoctor.dev/guide/start/cli

npx @rsdoctor/cli analyze --profile [.rsdoctor/manifest filepath]

@pushkargupta9807
Copy link
Author

Thank you @easy1090 . I tried that , but for my current app the build never ends and the manifest.json file is never generated.

I tried to scale down the features as well - as in the above config , but it still gets stuck.

@pushkargupta9807
Copy link
Author

pushkargupta9807 commented Mar 14, 2024

@easy1090 I think it is the loaders analysis which is making the build get stuck after compilation is complete. When I just use other features like [plugins] , the build completes with analysis.

As such I was wondering , do you have any insights so as to what might be causing the loader analysis getting stuck forever ? Any way I can debug the InternalLoaderPlugin below to see see what is causing it to never finish ? Or any other tips

image

Also I observe that the "@rsdoctor/core/plugins" is not present - is that expected?
image

@easy1090
Copy link
Collaborator

easy1090 commented Apr 23, 2024

Also I observe that the "@rsdoctor/core/plugins" is not present - is that expected?

This problem has been fixed #305. You can use the 0.2.0 version, current this version is a beta tag.

the loaders analysis which is making the build get stuck after compilation is complete

This problem is not meet yet. Can you give me your repo , I'll try to check this problem. Or you can give me your webpack.config.js. And whether your project has used Vue?

@easy1090
Copy link
Collaborator

You can try to use this options:

reportCodeType: {
   noCode: true
}

https://rsdoctor.dev/config/options/options#reportcodetype

@pushkargupta9807
Copy link
Author

Thank you! will try and let you know.

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

No branches or pull requests

2 participants