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
this causes errors TypeError: remoteEntryExports.init is not a function and files/main offline
this is because from old ancient times browsers put elements to window object by their id, so in the example above if we access window.files it will be <a> element, but it so happened that authors if this library also pollute window global space by putting some object there by remote name, so when it tries to access window.files instead of getting internal object it accesses DOM element which does not have init method
possible workarounds:
for contributors: fix library and do not put anything to window or at least make a special private space or use hashed remotes names
for users: prepend remotes names with some unique name that will never appear in window properties
Not our decisions. This is how it works on webpack. If I prefix or hash the name of the remote then how will you know what it called / how will it work with other parts of the ecosystem.
You can send a pr to improve the error message we throw
Describe the bug
another 1.5 hours wasted on some questionable decisions made by authors of @module-federation/next-mf lol
The title is self explanatory:
this causes errors
TypeError: remoteEntryExports.init is not a function
andfiles/main offline
this is because from old ancient times browsers put elements to window object by their id, so in the example above if we access
window.files
it will be<a>
element, but it so happened that authors if this library also pollute window global space by putting some object there by remote name, so when it tries to access window.files instead of getting internal object it accesses DOM element which does not haveinit
methodpossible workarounds:
Reproduction
https://github.com/module-federation/core
Used Package Manager
npm
System Info
Validations
The text was updated successfully, but these errors were encountered: