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
Upgrading a some dependencies in a svelte app where this persistent store was working. I haven't pinned down the precise culprit, my hunch/guess is rollup-plugin-node-resolve
but for some reason I was getting an error at startup.
bundles src/main.ts → public/build/bundle.js...
[!] Error: Could not load /path/to/project/node_modules/svelte-persistent-store/dist/dist/local (imported by src/store.js): ENOENT: no such file or directory, open '/path/to/project/node_modules/svelte-persistent-store/dist/dist/local'
I was able to solve by changing my import from
import { writable } from 'svelte-persistent-store/dist/local';
to
import { writable } from 'svelte-persistent-store/local.js';
The text was updated successfully, but these errors were encountered:
I believe that the rollup plugin behaves correctly because it respects ECMAScript modules. svelte-persitent-store sets the exports field in package.json. When importing the package as an ECMAScript module all paths svelte-persistent-store/foo/bar are rewritten to svelte-persistent-store/dist/foo/bar.
In theory it should now be possible to import from 'svelte-persistent-store/local'. But unfortunately this does not play well with Typescript because the compiler cannot find the types for svelte-persistent-store/local as it looks for ./node_modules/svelte-persistent-store/local.d.ts. A solution could be to include package type declarations in addition to the module type declarations. Alternatively, the dist directory prefix could be removed in the package archive.
Upgrading a some dependencies in a svelte app where this persistent store was working. I haven't pinned down the precise culprit, my hunch/guess is rollup-plugin-node-resolve
but for some reason I was getting an error at startup.
I was able to solve by changing my import from
to
The text was updated successfully, but these errors were encountered: