Skip to content

Commit

Permalink
ensure router is initialized when subscribing to session (#1691)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Jun 16, 2021
1 parent 926481f commit aedec24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-elephants-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Ensure router is initialized before parsing location
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/client/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class Renderer {
this.stores.session.subscribe(async (value) => {
this.$session = value;

if (!ready) return;
if (!ready || !this.router) return;
this.session_id += 1;

const info = this.router.parse(new URL(location.href));
Expand Down

0 comments on commit aedec24

Please sign in to comment.