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

Cannot find base config file "./.svelte-kit/tsconfig.json" #7028

Open
asendia opened this issue Sep 25, 2022 · 16 comments
Open

Cannot find base config file "./.svelte-kit/tsconfig.json" #7028

asendia opened this issue Sep 25, 2022 · 16 comments
Labels
types / typescript wontfix This will not be worked on
Milestone

Comments

@asendia
Copy link
Contributor

asendia commented Sep 25, 2022

Read this first

This is a harmless warning. To everyone who wants to silence this: Prepend your script with svelte-kit sync - e.g. "build": "svelte-kit sync && vite build

Describe the bug

I got this error warning when running npm run build in netlify:

[WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

I think vite build requires ./.svelte-kit/tsconfig.json, but ./.svelte-kit/tsconfig.json is generated after the first npm run build, CMIIW

Reproduction

Netlify build log sample: https://app.netlify.com/sites/salmonfit/deploys/6330b4585ff1820009b08c68
Repo: https://github.com/asendia/salmonfit/tree/5d32bea0c32889c25e5621306d3d47624f05877d

Logs

[WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

System Info

System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 634.39 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
    Yarn: 1.22.18 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
    npm: 8.8.0 - ~/.volta/tools/image/npm/8.8.0/bin/npm
  Browsers:
    Chrome: 105.0.5195.125
    Firefox: 92.0.1
    Safari: 16.0
  npmPackages:
    @sveltejs/adapter-netlify: ^1.0.0-next.78 => 1.0.0-next.78 
    @sveltejs/amp: ^1.0.0-next.1 => 1.0.0-next.1 
    @sveltejs/kit: next => 1.0.0-next.491 
    svelte: ^3.44.0 => 3.50.1 
    vite: ^3.1.0 => 3.1.3

Severity

annoyance

Additional Information

No response

@asendia asendia changed the title Cannot Cannot find base config file "./.svelte-kit/tsconfig.json" Sep 25, 2022
@asendia
Copy link
Contributor Author

asendia commented Sep 25, 2022

Similar issue: #6359

@Conduitry
Copy link
Member

As this message indicates, this is a warning, not an error. Are there any problems in your built app?

@asendia
Copy link
Contributor Author

asendia commented Sep 26, 2022

Nope, It is not blocking anything (severity: annoyance). I understand that this is less important and can be solved later, there are other urgent issues that need to be resolved before 1.0.

It is just that I consider any warning as important thing to solve, I could be wrong though.
https://www.cprogramming.com/tutorial/compiler_warnings.html

@jacob-8
Copy link
Contributor

jacob-8 commented Sep 26, 2022

I also have this problem in a monorepo when package A relies on components from package B. When package A is built, package B is missing its "./.svelte-kit/tsconfig.json" because it was never added on pnpm install. This problem has been with me ever since we removed the svelte-kit prepare script command.

@dummdidumm
Copy link
Member

To everyone who wants to silence this: Prepend your script with svelte-kit sync - e.g. "build": "svelte-kit sync && vite build

@asendia
Copy link
Contributor Author

asendia commented Sep 26, 2022

To everyone who wants to silence this: Prepend your script with svelte-kit sync - e.g. "build": "svelte-kit sync && vite build

TIL. Thanks, I will put svelte-kit sync in postinstall for now

@Rich-Harris Rich-Harris added this to the whenever milestone Nov 16, 2022
@ThomasMeli
Copy link

To everyone who wants to silence this: Prepend your script with svelte-kit sync - e.g. "build": "svelte-kit sync && vite build

Even doing this I still get the same error. Any ideas?

@dummdidumm dummdidumm added the wontfix This will not be worked on label Jan 10, 2023
@kavfam
Copy link

kavfam commented Apr 8, 2023

I got this warning using pnpm run dev (after pnpm create svelte and pnpm i) and worse, after the warning i got "Error: Not found: /chick". I do have a "chick" component in a previous project, nothing to do with the current project!?? I created a new folder, pnpm create svelte, pnpm i, pnpm run dev. I removed folder, repeated, same result. I figured maybe pnpm is a problem. I tried npm instead. This time no warning but still getting same "/chick" error! Not good. Tried removing pnpm (Windows pc) but so far no joy. Not sure what is really going on here but think pnpm has to be the problem.

@vloe
Copy link

vloe commented Apr 23, 2023

having the same issue using pnpm...

@t3hmrman
Copy link
Contributor

t3hmrman commented Jun 9, 2023

If you run into this while using pnpm, note that you can put the contents of create-svelte/tsconfig.json in your project directory (@ .svelte-kit/tsconfig.json)

@ghostdevv
Copy link
Member

To everyone who wants to silence this: Prepend your script with svelte-kit sync - e.g. "build": "svelte-kit sync && vite build

I'd say this is probably the way to solve this?

@t3hmrman
Copy link
Contributor

t3hmrman commented Jun 9, 2023

Sure that's reasonable -- what I was suggesting gets you past the error immediately (and is easy to understand), and then regular builds do the rest (.svelte-kit/tsconfig.json is repopulated).

Running svelte-kit sync is only necessary once though, so I'm not a fan of putting it in the "build" script to run every single time I build -- but people can pick what they'd like!

@Ashvith10
Copy link

Is this issue still not resolved? At least from what I've seen, adding this line:

"prepare": "svelte-kit sync"

to "scripts" in package.json fixed this issue for me both on local and Vercel while running dev and build.

@suvrotica
Copy link

Getting the same error and none of the methods above worked for me

@suvrotica
Copy link

ive tried everything above still i get Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

hyuckkim added a commit to hyuckkim/hyuckkim.github.io that referenced this issue Apr 2, 2024
@eltigerchino
Copy link
Member

@dummdidumm would it make sense to add a postinstall lifecycle script to the create-svelte templates so that it runs svelte-kit sync after installing the packages? I'm not sure what the drawbacks would be but at least the warning would disappear from build logs and wouldn't require running the dev server at least to get the generated types.

t03i added a commit to t03i/TMVisDB that referenced this issue Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types / typescript wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests