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
I've checked web worker related issues and seems this one is different?
Generally I want to achieve the following:
Suppose there is a lib (packages/dep) which exports a function createWorker, it spawns a web worker (not service worker) and the worker should be able to load content from remote module federation provider.
The createWorker function is imported by a web app and used there.
Now the problem:
rslib can build, but the createWorker function cannot work. The error log is:
[ Federation Runtime ]: [ Federation Runtime ]: The attribute remoteEntry of mf_remote must not be undefined.
However, the actual problem is that module federation runtime has a function called getRemoteEntryInfoFromSnapshot
Neither if branch is matched so it falls back to no url.
I'd like to know how to deal with this case.
If dep package is not built, then with rspack source build enabled, loadRemote also fails with the same error.
This is likely a problem with how federation runtime is applied to this target, i think i fixed this in webpack v1 - however there may be some additiional work for v2.
Describe the bug
I've checked web worker related issues and seems this one is different?
Generally I want to achieve the following:
Suppose there is a lib (
packages/dep
) which exports a functioncreateWorker
, it spawns a web worker (not service worker) and the worker should be able to load content from remote module federation provider.The
createWorker
function is imported by a web app and used there.Now the problem:
createWorker
function cannot work. The error log is:However, the actual problem is that module federation runtime has a function called
getRemoteEntryInfoFromSnapshot
Neither
if
branch is matched so it falls back to no url.I'd like to know how to deal with this case.
loadRemote
also fails with the same error.Reproduction
https://github.com/yf-yang/modernjs-monorepo-example
Then open localhost:8080 and click "Create worker from dep", it should call
loadRemote
from within a workerUsed Package Manager
pnpm
System Info
System: OS: macOS 13.2.1 CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz Memory: 77.39 MB / 32.00 GB Shell: 5.8.1 - /bin/zsh Browsers: Chrome: 133.0.6943.98 Safari: 16.3 npmPackages: @rslib/core: 0.5.0-alpha.0 => 0.5.0-alpha.0
Validations
The text was updated successfully, but these errors were encountered: