You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the dts_plugin in an rsbuild basic setup there is one part of the manifest generation that disallows using a path instead of an absolute url for remotes: i.e. '/my-path' instead of 'https://app.com/my-path'.
Since everything 'works' fine with paths instead of absolute urls (except this zip path) I'd hazard this is a bug.
start Compiling...
Unhandled Rejection Error: TypeError: Invalid URL
at new URL (node:internal/url:775:36)
at buildZipUrl (/Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:1603:21)
at retrieveRemoteInfo (/Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:1621:24)
at /Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:1645:26
at Array.reduce (<anonymous>)
at resolveRemotes (/Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:1642:24)
at retrieveHostConfig (/Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:1658:32)
at getLocalRemoteNames (/Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:2389:36)
at forkDevWorker (/Users/xxx/Development/temp/federation_consumer/node_modules/@module-federation/dts-plugin/dist/forkDevWorker.js:2472:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
federation_consumer Process(64855) unhandledRejection, mf server will exit...
Since the baseUrl will only be used when the first argument is a path and otherwise ignored I changed the locally installed (compiled) package to construct the url with an arbitrary domain which I check for and remove if present in the final url, something like:
I can't open a PR right now unfortunately, (pnpm install failing on node-gyp, probably something with my python environment but I can't look into it now).
Describe the bug
When using the dts_plugin in an rsbuild basic setup there is one part of the manifest generation that disallows using a path instead of an absolute url for remotes: i.e. '/my-path' instead of 'https://app.com/my-path'.
Since everything 'works' fine with paths instead of absolute urls (except this zip path) I'd hazard this is a bug.
The error stems from the following code where the remoteUrl is passed to new URL (which requires a second 'baseUrl' param is passed a path).
dts-plugin
Suggested solution
Since the baseUrl will only be used when the first argument is a path and otherwise ignored I changed the locally installed (compiled) package to construct the url with an arbitrary domain which I check for and remove if present in the final url, something like:
Reproduction
https://github.com/adamdharrington/mod-fed-dts-error/blob/main/rsbuild.config.ts#L24
Used Package Manager
npm
System Info
Validations
The text was updated successfully, but these errors were encountered: