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

tsconfig.json generated by SvelteKit dev server incorrectly includes parents directory #8898

Closed
wvhulle opened this issue Feb 6, 2023 · 5 comments · Fixed by #8880
Closed

Comments

@wvhulle
Copy link

wvhulle commented Feb 6, 2023

Describe the bug

When a custom files.routes option is specified in the svelte.config.js file, the "include" section of the generated tsconfig file in the .svelte-kit folder is instantiated with globs referencing parent directories.

It get entries like this:

		"../../../../../**/*.js",
		"../../../../../**/*.ts",
		"../../../../../**/*.svelte",

Instead of the expected "../src/" or "../routes/". I think this is slowing down my editor and I don't know how to fix this, because the file is autogenerated by default everytime I run the dev server.

Reproduction

https://github.com/wvhulle/sveltekit-parent-directory-bug

Logs

No response

System Info

System:
    OS: Linux 5.15 Linux Mint 21.1 (Vera)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
    Memory: 3.22 GB / 15.36 GB
    Container: Yes
    Shell: 3.5.1 - /usr/bin/fish
  Binaries:
    Node: 19.4.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.2.0 - /usr/local/bin/npm
  Browsers:
    Chromium: 109.0.5414.74
    Firefox: 109.0
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.0 => 1.0.2 
    @sveltejs/kit: ^1.0.0 => 1.3.10 
    svelte: ^3.54.0 => 3.55.1 
    vite: ^4.0.0 => 4.1.1 


### Severity

blocking all usage of SvelteKit

### Additional Information

_No response_
@wvhulle
Copy link
Author

wvhulle commented Feb 6, 2023

In that issue, it states that there is only one level too high, but for me it seems like there are multiple extra levels.

dummdidumm added a commit that referenced this issue Feb 7, 2023
closes #8872
closes #8898

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
@wvhulle
Copy link
Author

wvhulle commented Feb 7, 2023

It is not solved yet on master branch.

@wvhulle
Copy link
Author

wvhulle commented Feb 7, 2023

@dummdidumm dummdidumm reopened this Feb 7, 2023
@wvhulle
Copy link
Author

wvhulle commented Feb 7, 2023

It seems like the location of the lib and routes folder only results in the correctly generated tsconfig if they are inside the default src directory. When I move them away from each other or to a parent directory they are translated into nameless relative imports of parent directories.

@wvhulle
Copy link
Author

wvhulle commented Feb 7, 2023

Sorry it seems to be solved in master. I had trouble installing and used the 1.50 by mistake. Just the unnecessary src import remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants