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
Seems like Parcel does not bundle Svelte internals correctly for external packages that rely on them. Everything builds correctly, but then I get a clientside error:
Uncaught TypeError: store.subscribe is not a function
at Object.subscribe (index.mjs:41)
at V (yrv.min.js:1)
at Object.init (index.mjs:1350)
at new W (yrv.min.js:1)
at create_fragment (App.svelte:236)
at init (index.mjs:1364)
at new App (App.svelte:300)
at Object.parcelRequire.main.js../App.svelte (main.js:3)
at newRequire (main.1f19ae8e.js:47)
at main.1f19ae8e.js:81
I think it's a Parcel error because it works fine with Rollup. Per default Parcel grabs pkg.browser entry and if that doesn't exist it grabs pkg.module. Both of them give the same error. However, in external package there is also pkg.svelte that points to the raw source. When pointing to that entry (removing pkg.browser and manually pointing pkg.module to src/index.js directly in node_modules dir) everything works.
From what I saw in Svelte plugin code pkg.svelte is used for compiler options. I am also not aware of any bundler that uses pkg.svelte entry point during package resolution and I don't know what is considered a standard, so TBH I am not sure why the author put it there in the first place and what purpose it serves.
馃悰 Bug Report
Seems like Parcel does not bundle Svelte internals correctly for external packages that rely on them. Everything builds correctly, but then I get a clientside error:
External package in question: https://github.com/pateketrueke/yrv
I think it's a Parcel error because it works fine with Rollup. Per default Parcel grabs
pkg.browser
entry and if that doesn't exist it grabspkg.module
. Both of them give the same error. However, in external package there is alsopkg.svelte
that points to the raw source. When pointing to that entry (removing pkg.browser and manually pointing pkg.module tosrc/index.js
directly in node_modules dir) everything works.From what I saw in Svelte plugin code
pkg.svelte
is used for compiler options. I am also not aware of any bundler that usespkg.svelte
entry point during package resolution and I don't know what is considered a standard, so TBH I am not sure why the author put it there in the first place and what purpose it serves.馃帥 Configuration (.svelterc, package.json, cli command)
Available in code sample.
To reproduce run the command below and check the browser's dev console:
yarn parcel serve src/index.html --port 3000 --log-level 4 --no-cache
馃捇 Code Sample
https://github.com/iljoo/svelte-parcel-yrv-bug
馃實 Your Environment
Yarn, plus latest and greatest Parcel and Svelte.
The text was updated successfully, but these errors were encountered: