hilla icon indicating copy to clipboard operation
hilla copied to clipboard

NPE when navigating to server side view during first server side view initialization

Open Artur- opened this issue 5 years ago • 6 comments
trafficstars

Description of the bug

If you navigate to another Java view while Flow is being initialized, navigation fails, the application disappears and only a blank page is shown

Minimal reproducible example

App with three views:

  1. root view (TS)

  2. view 1 (Java)

  3. view 2 (Java)

  4. Open the "root" view

  5. Navigate to "view 1"

  6. While navigation is in progress, navigate to "view 2"

Test project: https://github.com/Artur-/routing-error

  1. Run mvn
  2. open http://localhost:8080/
  3. Rapidly click "View 1" and then "View 2"

Expected behavior

I should end up on "view 2"

Actual behavior

A blank screen is shown and a JS exception from https://github.com/vaadin/flow/blob/9a67dbc4393af97e57c36dcd7c112895e0687b9d/flow-client/src/main/resources/META-INF/resources/frontend/Flow.ts#L127 stating that onBeforeEnter cannot be set because this.container is undefined.

Versions:

- Vaadin / Flow version: 17
- Java version: 13
- OS version: Mac
- Browser version (if applicable): Chrome
- Application Server (if applicable): Spring Boot
- IDE (if applicable): VS Code

Artur- avatar Aug 04 '20 10:08 Artur-

I think this issue is fixed by https://github.com/vaadin/flow/pull/12228? @Artur-

haijian-vaadin avatar Nov 17 '21 12:11 haijian-vaadin

Let me verify

Artur- avatar Nov 17 '21 12:11 Artur-

Still broken in the same way with 22.0-SNAPSHOT

Artur- avatar Nov 17 '21 12:11 Artur-

Just tried, with the attached testing project, it works fine for me with both 22.0.0.rc1 and 23.0-SNAPSHOT npe-verify.zip

haijian-vaadin avatar Nov 29 '21 07:11 haijian-vaadin

That's a different project. It does not even have a TS view.

Artur- avatar Nov 29 '21 07:11 Artur-

right, I am now able to reproduce it.

haijian-vaadin avatar Nov 29 '21 07:11 haijian-vaadin