romkor / svelte-portal

Svelte component for rendering outside the DOM of parent component
https://svelte.dev/repl/407576d4fa984cfb97dcdd3da98e833e
MIT License
439 stars 21 forks source link

Changes in 2.2.1 caused import error when following the old documentation #180

Open FreekyMage opened 8 months ago

FreekyMage commented 8 months ago

The latest update should probably not have been a patch version bump. We were using import Portal from "svelte-portal/src/Portal.svelte"; like the documentation suggested. This caused builds to fail with this new version, even in projects that didn't directly import it. A patch gets applied even with a simple install command if you're using the widely accepted ^ for your versions. In our case this was ^2.2.0.

Now the version can't be changed anymore, but the documentation should be updated to not show broken code.

Renkas commented 7 months ago

Error: Missing "./src/Portal.svelte" specifier in "svelte-portal" package

Is this the same issue? Is there a workaround?

EDIT: workaround/fix is to import Portal this way: import Portal from "svelte-portal";

FreekyMage commented 7 months ago

Not sure if we had the exact same error, but your edit is the fix, just like how it is in the top part of the documentation.