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.

Is there a way to escape the SPA routing?

See original GitHub issue

I have mutliple associated applications running on a parent domain, that will sometimes need to link to each other.

Let’s say the thing lives at example.com. The Svelte app using svelte-router is on /projects, where it handles its content through nested routes – /projects/my-example-project for instance. When I now create a Navigate or anchor element linking to /otherapp or example.com/otherapp, the SPA router can’t find a configured route and shows a 404 page – instead of requesting the page from the server. While this is in itself expected behaviour, apart from setting target="_blank" I don’t see a way to reliably handle this scenario.

I know there’s a way to display a custom 404 page – is there a way to handle requests that would result in a 404 before routing happens and send failed root-relative URLs or URLs for the same base domain back up to the server? Anything else I’ve missed?

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreasMaroscommented, Nov 23, 2020

Sorry for the late reply, I only just got around to testing it – and it works beautifully, just as I expected.

Thank you for this magnificent tool and your lightning-fast reaction to my problem, appreciate the great work!

0reactions
jorgegorkacommented, Nov 24, 2020

@AndreasMaros Thank you for your comment!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Routing: I'm not smart enough for a SPA - DEV Community ‍ ‍
But this discussion has been great. It's made me think of how I can simplify my offline app more using a truer MPA...
Read more >
Is there a way to restrict access to certain routes using svelte ...
I am trying to build an authentication page and I want to restrict the user's access to certain routes until they are logged...
Read more >
Single Page Apps routers are broken | by Robert DeLuca
Currently, every major Single Page App's (SPA) router is broken the second you install it (Ember, Angular, React/Preact/Vue.js, etc).
Read more >
Spa Tour Part 1 - Peacekeeper Task Guide - YouTube
Spa Tour Part 1 - Peacekeeper Task Guide - Escape From Tarkov ; Subscribe: https://tinyurl.com/442knp57 ; | Membership: https://tinyurl.com/ ...
Read more >
How to get to Massage Escape Spa in Washington by Bus or ...
How to get to Massage Escape Spa by Metro? Click on the Metro route to see step by step directions with maps, line...
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