rsdoctor: [Bug]: [webpack-dev-middleware] RangeError: Invalid string length
Version
N/A
Details
Entrypoint main 116 MiB = main-8d27d6eb9b39386ef1df.js Entrypoint unsupportedBrowser 887 KiB = unsupportedBrowser-b4d2fea7fce3de54a441.js Entrypoint reactdevtools 645 KiB = reactdevtools-b671b3ece8b25cd3fd9b.js Rspack 0.5.2 compiled successfully in 27.12 s (2faf356ab27d33a22682) <e> [webpack-dev-middleware] RangeError: Invalid string length <e> at PassThrough.<anonymous> (/Users/pushkargupta/source/teams-modular-packages/node_modules/@rsdoctor/utils/dist/cjs/build/json.js:33:16) <e> at PassThrough.emit (node:events:513:28) <e> at addChunk (node:internal/streams/readable:315:12)
Running into the above error with rsdoctor and serving an application.
Reproduce link
N/A
Reproduce Steps
yarn rspack serve with rsdoctor
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 23 (11 by maintainers)
@easy1090 Thank you for looking into this! I can confirm that with the latest version RsDoctor now works as expected for our application 👍 . I did not need do set
noAssetsAndModuleSource, the plainnew RsdoctorWebpackPlugin()works as well.@pushkargupta9807 This issue has fixed by #419
I will open another one issue #426 for the optimize of the large loader data .
@pushkargupta9807 I’ll try to fixed this problem this week.
@pushkargupta9807
If you turn on the loader option, an invalid string length error will occur, right?
@pushkargupta9807 @zackarychapple
After detailed investigation, it was found that there is a problem with the noAssetsAndModuleSource configuration in the rspack mode (I made the problem more complicated, which led to a delay in solving this problem for a relatively long time). Please try the rsdoctor @0.3.2 version, and at the same time, add the following reportCodeType configuration:
I have tried the above scheme for a project that also has this problem, and it is effective. If you have any questions, please continue to contact me.
In addition, if it is an MF project, there may be a problem of the overly large size of stats.json, because the identifier of the container entry module of the issuerPath may be very long, and the container entry module may appear very many times. The overly large stats.json will lead to too slow analysis of rsdoctor. It can be considered to turn off the ability to parse the bundle to some modules, and the configuration is as follows:
I’ll find a repo has this similar problem and fix this problem by reproduction the chunk graph data structure.