Open jameszhang2020 opened 4 weeks ago
Hello @jameszhang2020. Please provide a reproduction repository or online demo. For background, see Why reproductions are required. Thanks ❤️
Hi, can you provide a minimal reproduction for this?
@chenjiahan https://github.com/TD-jameszhang/rsbuild-demo.git In this repo, after I upgraded to the latest version of rsbuild/core, it reported this error first (which prevented me from reproducing the original problem) Reproduce Steps:
Maybe, it need to fix this problem first before I can reproduce the abnormal phenomenon reported first.
By the way, Is this correct? It looks weird. Because the current @rspack/core of this project is already version 0.7.1
In this repo, after I upgraded to the latest version of rsbuild/core, it reported this error first
This is a bug of Rspack and has been fixed, see: https://github.com/web-infra-dev/rspack/issues/6740
You can upgrade Rsbuild to v0.7.7 and the live reload / HMR should work
By the way, Is this correct? It looks weird. Because the current @rspack/core of this project is already version 0.7.1
This is a devDependency, it will not affect your project, so you can just ignore it
Can you try the latest Rsbuild version and check if the problem has been resolved?
OK, got it. I'll verify it later and contact you if I have any news.
The HMR problem should be fixed. However, the problem I mentioned at the beginning still exists. Here are the results after I ran it:
But I expect it to work properly, as shown below(There are detailed descriptions in the issue):
I have uploaded the code to the repo, could you please take a look at it?
@chenjiahan bumping this. Could it be related to lazy compile? Not sure why the scope would reset like this
I tried to modify .ts files or the rsbuild config file, but I can not reproduce the error:
And the project does not have lazyCompilation enabled, so it should not be related to lazy
I'll try playing with it too and see if I can reproduce anything
Version
Details
I have shared multiple packages in the module federation host, and the configuration is as follows.
On first startup, it will generate a set of configurations that can be found in the entry file (index.js), like this:
However, when I edited a ts file or rsbuild.config.ts file, saved it, and then checked it again, I found that it became empty, as shown below:
Other remotes will depend on these shared packages, so this initializeSharingData.scopeToSharingDataMapping is very important
Reproduce link
N/A
Reproduce Steps
__webpack_require__.initializeSharingData
in the index.js file generated after packaging is different before and after (as described above). If this variable has a normal value, our project can work normally, otherwise it will not work.