Skip to content
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

svelte-kit package $lib reference conflicts with outer svelte project $lib #1985

Closed
thinkloop opened this issue Jul 22, 2021 · 1 comment
Closed
Labels
pkg:svelte-package Issues related to svelte-package

Comments

@thinkloop
Copy link

thinkloop commented Jul 22, 2021

Describe the bug

I generated a package, copied it into another svelte project, but all the references to $lib inside the package look for files in the outer svelte project's $lib rather in itself - any way around that?

I get the error:

failed to load module for ssr: /src/lib/utils/fullscreen

Because the file is correctly at:

/src/MY-PACKAGE/utils/fullscreen

Reproduction

Make a project that includes some $lib imports.
Package the project with svelte-kit package.
Rename and copy the package into another svelte project.
Load one of the packages entry points in the new project.

Notice that the entry point is trying to find its dependency in the outer project's $lib folder rather than its own.

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 6.49 GB / 31.92 GB
  Binaries:
    Node: 14.17.3 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.71)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @sveltejs/adapter-vercel: ^1.0.0-next.0 => 1.0.0-next.0
    @sveltejs/kit: next => 1.0.0-next.132
    eslint: ^7.22.0 => 7.31.0
    eslint-config-prettier: ^8.1.0 => 8.3.0
    eslint-plugin-svelte3: ^3.2.0 => 3.2.0
    less: ^4.1.1 => 4.1.1
    prettier: ~2.2.1 => 2.2.1
    prettier-plugin-svelte: ^2.2.0 => 2.3.1
    svelte: ^3.34.0 => 3.38.3
    svelte-preprocess: ^4.7.4 => 4.7.4

Severity

serious, but I can work around it

Additional Information

No response

@benmccann benmccann added the pkg:svelte-package Issues related to svelte-package label Jul 22, 2021
@dummdidumm
Copy link
Member

Duplicate of #1950 . Aliases need to be resolved when packaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:svelte-package Issues related to svelte-package
Projects
None yet
Development

No branches or pull requests

3 participants