Type ActionData is unknown
in TypeScript, but correct in JavaScript in VSCode
#6668
Labels
unknown
in TypeScript, but correct in JavaScript in VSCode
#6668
Describe the bug
It seems that there's a bug, when inferring types from the new
actions
export (recently merged #6469), in the+page.server.ts
files.I'm using the
Svelte for VS Code v105.22.1
extension.In short, the ActionData type is not inferred correctly in TypeScript projects. But it is in JavaScript projects.
Reproduction
The issue can be tested with this project https://github.com/jeppech/svelte-action-data-ts-bug
js
folder, install dependencies and run the dev script.cd js && pnpm install && pnpm run dev
ts
folder, install dependencies and run the dev script.cd ts && pnpm install && pnpm run dev
Open the
js
andts
folder, in their own instance of VSCode.In the JavaScript project
src/routes/+page.svelte
: TheActionData
-type has ahorse
property, which is correctly inferred from the+page.server.js
fileIn the TypeScript project
src/routes/+page.svelte
: TheActionData
-type isunknown
, so it's not being inferred correctly from the+page.server.ts
fileLogs
No response
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: