Investigating the issue, I see that it correctly identifies that the route isn't one of my app routes. However, it then checks if it matches the fallback, and it does:
// In router/index.js
async navigate(url) {
if (typeof url === 'string') {
url = new URL(url, this.baseUrl);
}
// THIS IS THE LINE IN QUESTION:
// The _matchRoute(url) correctly returns falsey, but _matchRoute(this.fallback) returns the fallback route.
// A few lines later we call window.history.pushState(null, '', `${url.pathname}${url.search}`), and this fails with error.
this.route = this._matchRoute(url) || this._matchRoute(this.fallback);
log(`Navigating to ${url.pathname}${url.search}`, { context: this.context, route: this.route });
}
Custom protocols, like the ones Github uses when it tries to launch Github Desktop or VS Code, will cause the router to throw an error.
Example custom protocol:
x-github-client://openRepo/https://github.com/pwa-builder/pwabuilder-oculus
If I use App Tools Router, then have a link in my app:
Clicking on that link will cause the router to throw an error:
Investigating the issue, I see that it correctly identifies that the route isn't one of my app routes. However, it then checks if it matches the fallback, and it does:
Would you accept a PR fixing this?