-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Missing types in @sveltejs/kit #5114
Comments
Possibly related to work in #2514 |
This works as expected. |
Thanks for quick response @dummdidumm. However... Removing $app from paths breaks bunch of import lint checks in #1560. Which is not good to have unchecked and therefore possibly broken imports. Adding $app fixed all of these lint errors. Is there other way to have all imports linted in my proposed fix in #1560? ESLint does not seem to be picking up the /// reference. But my point here is different - it is that typedef My ask here is to add typedef |
Bump! ask here is to add typedef interface Client to the @sveltejs/kit package types, since it is exposed in the API, but not present in types. For one, ESLint is not finding the types based on /// reference. |
Where is |
The Client type is pulled from file ".svelte-kit/runtime/client/singletons.js" which has this line at the top: The file is created by Svelte-kit. The steps to get the error are trivial and listed in the issue, I also posted a repro repo: Have you looked at it? |
Describe the bug
Setup
Run check
pnpm run check # no errors
Modify tsconfig.json:
Run check with modified tsconfig.json
Expected: no errors
Actual: 2 errors
The same 2 errors are thrown when just running
tsc
.Reproduction
https://github.com/iva2k/sveltejs-kit-issue-types-20220529
Logs
System Info
Severity
serious, but I can work around it
Additional Information
Apparently, defining
$app
alias intsconfig.json
enables Typescript to analyzeimport('$app/navigation')
informs.ts
, which pulls in files that lack Typescript types. Removing$app
from tsconfig.json.compilerOptions.paths hides the problem,I checked @sveltejs/kit repo, and found some *.d.ts files that are not bundled into the distributed package, and one of them (@sveltejs/kit/packages/kit/src/runtime/client/types.d.ts) contains
interface Client
, which is missing in the bundle.This issue manifested itself when making a fix for #1560, and remains hidden until $app alias is defined.
The text was updated successfully, but these errors were encountered: