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' outputs package dir relative to tsconfig, but post-build code searches relative to svelte.config.js #3001

Open
martaver opened this issue Dec 7, 2021 · 0 comments
Labels
bug Something isn't working pkg:svelte-package Issues related to svelte-package
Milestone

Comments

@martaver
Copy link

martaver commented Dec 7, 2021

Describe the bug

I'm experimenting with a setup that has sveltekit apps and libs in the same monorepo, in subdirectories. To cater to this, I have a single svelte.config.js that accepts a subdir as argument and adds it to files, vite.cachedir and vite.server.fs.allow.

I noticed that when trying to publish a lib, the svelte-kit package command fails with:

> ENOENT: no such file or directory, scandir '<repo_root>/package'

Searching for the missing package folder, I find it nested under libs/ui, which is surprising, because I haven't set package.dir in svelte.config.js yet.

If I set package.dir to libs/ui/package, then the ERROR now shows the correct path, but the package dir is now doubly nested under libs/ui/libs/ui/package.

Fiddling around, it seems that package.dir emits relative to tsconfig.json, because if I move it around, the relative package dir also moves.

Reproduction

https://github.com/cleric-sh/repro/tree/sveltekit-package-nested-dir

just clone and yarn && yarn svelte-kit package

Logs

No response

System Info

npx: installed 1 in 1.152s

  System:
    OS: macOS 11.2.3
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 2.41 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.15 - ~/.nvm/versions/node/v14.17.6/bin/npm
  Browsers:
    Chrome: 96.0.4664.55
    Firefox: 92.0
    Safari: 14.0.3
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.3 
    @sveltejs/adapter-node: next => 1.0.0-next.55 
    @sveltejs/kit: next => 1.0.0-next.201 
    svelte: ^3.44.2 => 3.44.2

Severity

serious, but I can work around it

Additional Information

No response

@dummdidumm dummdidumm added the pkg:svelte-package Issues related to svelte-package label Dec 7, 2021
@martaver martaver changed the title 'svelte-kit package' outputs package dir relative to tsconfig, but command looks relate to svelte.config.js 'svelte-kit package' outputs package dir relative to tsconfig, but post-build code searches relative to svelte.config.js Dec 8, 2021
@Rich-Harris Rich-Harris added the bug Something isn't working label Apr 28, 2022
@Rich-Harris Rich-Harris added this to the 1.0 milestone Apr 28, 2022
@benmccann benmccann modified the milestones: 1.0, post-1.0 Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:svelte-package Issues related to svelte-package
Projects
None yet
Development

No branches or pull requests

4 participants