-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate preact-iso entries #599
Comments
with dev server, or prerender build? |
There are two levels of fix here: the easy quick fix is to remove (and stop recommending usage of) the specific entry modules from |
Mhmm, I experience no problems at all using imports from
My |
In my WMR experience using an NPM package dependency which contains an export map, it is critical that if / when a JS file within that package imports another "local" JS file (from the same package), the import MUST be done via the "absolute" export map path instead of the file's relative path (otherwise: duplicate JS load in WMR dev server => weird errors at runtime, particularly with modules that hoist some internal state at the module root). So my guess is that the developer who reported this bug also imports from wmr/packages/preact-iso/index.js Lines 1 to 3 in a46fcce
...which obviously conflicts with the export map: wmr/packages/preact-iso/package.json Lines 13 to 19 in a46fcce
|
@danielweck Right - the issue here is still present even when using the exports correctly:
The solution for this is basically that we need to treat any relative path imports within export-map-enabled packages as export mapped ones, including specifiers that reference files that are the right-hand-side of the export map. With that fixed, export { Router, LocationProvider, useLocation, Route } from '/@npm/preact-iso/router';
export { default as lazy, ErrorBoundary } from '/@npm/preact-iso/lazy';
export { default as hydrate } from '/@npm/preact-iso/hydrate'; |
Reported via slack:
Looks like the module is loaded twice.
The text was updated successfully, but these errors were encountered: