question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shadow endpoints navigation within same route

See original GitHub issue

Describe the bug

How can we navigate if route component and endpoint won’t change? Currently its not work as expected. If we have say: /example/[…rest].js /example/[…rest].svelte

And try to use links on page like: href=“/example”, href=“/example/1”, href=“example/2” — navigation between them won’t work (page not updates, only address bar changes)

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-x92deg?devtoolsheight=33&file=src/routes/example/[...rest].js

Logs

No response

System Info

kit next 260

Severity

serious, but I can work around it

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
ambiguous48commented, Feb 5, 2022

I’ve tried your workaround and it doesn’t work for searchParams as far as I can tell.

In my case I’m using url.searchParams (not params) and I can’t seem to get the shadow endpoint to pick up changes in the url.searchParams after navigating with goto.

After a manual refresh, the first time calling goto works as expected. Then, the url continues to change as expected, the load function is able to pick up the changes, but not the shadow endpoint.

2reactions
tmarnetcommented, Feb 8, 2022

Noticed the same issue with both:

  • search params, e.g. navigating from /movies to /movies?q=foo using goto(), the shadow endpoint doesn’t receive the q search param
  • dynamic params, e.g. navigating from /movies/1 to /movies/2 (assuming we have a /movies/[id] route) using a regular link, the shadow endpoint doesn’t seem to be called with the new id param
Read more comments on GitHub >

github_iconTop Results From Across the Web

Page/Shadow Endpoint in Sveltekit - YouTube
In this video, I will be showing how to use page endpoints or previously called as shadow endpoints in Sveltekit.00:00 Intro00:29 How to ......
Read more >
How to pass data from sveltekit route to shadow endpoint .ts
With this code we can get message from .ts file and show it in .svelte route; How can I pass postId from sample.svelte...
Read more >
Minimize the production impact of ML model updates with ...
This lets you setup shadow tests for a predefined duration of time, monitor the progress through a live dashboard, clean up upon completion,...
Read more >
URL Parameters | Routing and Navigation | Hilla Docs
Route parameters are useful when the same Web Component needs to be rendered for multiple paths, where part of the path is static,...
Read more >
API Routes - Remix
You might be used to building React apps that don't run on the server, or least not very much of it does, so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found