PageData types don't update to reflect changes to load function(s)
See original GitHub issueDescribe the bug
Having a +page.server.ts
load function with no +page.ts
load function results in PageData
being any
Making changes to +page.ts
load function means the PageData
types lag and mismatch.
Reproduction
Just add and remove some static props to the load
function return object.
Logs
No response
System Info
System:
OS: macOS 12.5
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 1.56 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
npm: 8.3.1 - /usr/local/bin/npm
Browsers:
Brave Browser: 102.1.39.111
Chrome: 104.0.5112.79
Chrome Canary: 106.0.5243.0
Firefox: 103.0.2
Safari: 15.6
Safari Technology Preview: 16.0
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.64
@sveltejs/kit: next => 1.0.0-next.411
svelte: ^3.44.0 => 3.49.0
vite: ^3.0.0 => 3.0.8
Severity
annoyance
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:12 (4 by maintainers)
Top Results From Across the Web
SvelteKit - api response data (PageData) not updated after ...
If a load function is triggered to re-run, the page will not remount — instead, it will update with the new data ....
Read more >Sveltekit Changes: Load Function - DEV Community
In this article i'm going to explain you about new changes in load function of sveltekit framework. How it is changes after sveltekit...
Read more >Loading data • Docs • SvelteKit
Notice that the type changed from PageLoad to PageServerLoad , because server load functions can access additional arguments. To understand when to use ......
Read more >WordPress Changes Not Showing? 3 Methods to Fix It Right ...
When WordPress is not showing changes right away, it is most likely still displaying a cached version. Learn three ways to fix this...
Read more >Load and display paged data - Android Developers
On this page · Define a data source. Select key and value types; Define the PagingSource; Handle errors · Set up a stream...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CaptainCodeman could you check if your errors still persist? I’m having trouble to figure out if this is one or multiple issues. The “type doesn’t update” issue should be resolved in the latest Svelte for VS Code extension version.
I’ve noticed the same thing with all exports of
./$types
. If you open the./$types
file, all exports are typed correctly, but when importing them from a+page.svelte
, they are typed asany
,unknown
ornever
.As @AdrianGonz97 mentioned, reloading vscode helps, so my guess is that the problem is in vscode not reading the files on each update.
+page.server.ts
+page.svelte