parcel-plugin-svelte icon indicating copy to clipboard operation
parcel-plugin-svelte copied to clipboard

Duplicate svelte/internals leads to various errors

Open canadaduane opened this issue 3 years ago • 1 comments

🐛 Bug Report

This is a bit difficult to track down, so let me outline a few pieces to the puzzle.

First, the error I'm getting is

Uncaught (in promise) TypeError: Cannot read property 'c' of undefined
    at transition_out (index.mjs:785)
    at Object.outro [as o] (Mirror.svelte:1127)
    at transition_out (index.mjs:793)
    at Object.outro [as o] (SampleApp.svelte:83)
    at transition_out (index.mjs:793)
    at Object.update [as p] (SampleApp.svelte:249)
    at update (index.mjs:741)
    at flush (index.mjs:709)

This appears to be the same issue as reported here and here.

Like the other issues reported above, I'm importing a svelte component from another npm package. Both the parent project and the child package happen to be my own. I believe what's happening is that two copies of svelte/internals is being loaded, and the resulting error message (again, above) is a symptom.

One solution proposed for webpack is to use resolve.mainFields. Is there an equivalent directive in parceljs?

Is there another way to direct parceljs to use only one copy of svelte/internals?

🌍 Your Environment

Svelte version: 3.29.0

Parcel version: 1.12.4

canadaduane avatar Oct 07 '20 23:10 canadaduane

Yes, I'm having the same the problem

cupcakearmy avatar Oct 12 '20 15:10 cupcakearmy