aurelia / aurelia/framework

<map><area router-href + PushState :: Whole page reloads

Open
#819 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.7k
Forks
608
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
aurelia-framework@1.1.4 (according to `npm list`)

**Please tell us about your environment:**
* **Operating System:**
Windows 10

* **Node Version:**
6.9.4

* **NPM Version:**
3.10.10

* **Aurelia CLI OR JSPM OR Webpack AND Version**
CLI 0.30.1

* **Browser:**
Chrome 59 | Edge 15.15063

* **Language:**
ESNext

**Current behavior:**

Router is configured to use the Push State API.
If one clicks on the `` link, the whole page will reload. Nevertheless, Aurelia route to the right template. So I assume PushState is not used.

app.js:
```ES
export class App {

configureRouter(config, router) {
config.options.pushState = true;
// [...]
```
p1.html:
```HTML

p1



```

**Expected/desired behavior:**

The app navigates in-app to the destination template/page (without reloading the website) and uses PushState.

Unfortunately, I cannot provide a *runnable* gist because PushState does not seem to work on GistRun:

`VM564 aurelia.js:14638 ERROR [app-router] Router navigation failed, and no previous location or fallbackRoute could be restored.`

* **What is the motivation / use case for changing the behavior?**
This bug circumvents many advantages of a SPA.

Contributor guide

Open the contributing guide

Research direction

Reproduce the navigation from app.js, where PushState is enabled, using the route-href on the element in p1.html. Start by tracing the router navigation triggered by that element and compare it with a normal in-app link; done means navigation reaches the destination template without a full-page reload and preserves PushState behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.