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.

Push not enabled despite annotation `@Push` added to `AppShell` in Vaadin 16

See original GitHub issue

To reproduce:

AppShell class contents:

@PWA(name = "Project Base for Vaadin", shortName = "Project Base", enableInstallPrompt = false)
@Push
public class AppShell implements AppShellConfigurator {
}

The MainView class contains only this code:

@Route("")
public class MainView extends VerticalLayout {

    @Override
    protected void onAttach(AttachEvent attachEvent) {
        add(new Span("pushed"));
        getUI().get().push();
    }
}

Erroneous behavior: The explicit UI::push in call fails with the following:

java.lang.IllegalStateException: Push not enabled
	at com.vaadin.flow.component.UI.push(UI.java:654)
	at org.vaadin.example.MainView.onAttach(MainView.java:21)
	at com.vaadin.flow.component.ComponentUtil.onComponentAttach(ComponentUtil.java:230)
...

Expected behavior: The explicit UI::push call does not fail. This works in Vaadin 15 series versions, e.g., 15.0.4.

Versions:

  • Vaadin 16.0.0.beta1
  • Java 8

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nicoulajcommented, May 27, 2020

@manolo It’s a regression between 15 and 16. I believe it is more related to AppShellConfigurator not used correctly to initialize UI.pushConfiguration. Push works correctly after I enable it using the property.

0reactions
manolocommented, May 27, 2020

As reference, the workaround is to use the server side bootstrap by enabling the appropriate flag

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Vaadin FLOW server-push with Spring Boot
You must add annotation for the "whole" application (which @Push is) to your central configuration place (which is the class implementing ...
Read more >
Upgrade Guide Generator | Upgrading | Vaadin Docs
Upgrade Guide Generator · Select your Vaadin versions: · Before You Start · Vaadin 14 to 23 Upgrade Guide · Upgrade Steps |...
Read more >
Index (Flow Server 4.0.0 API) - javadoc.io
A - Static variable in annotation type com.vaadin.flow.component. ... Enables push if push support is available and push has not yet been enabled....
Read more >
CUBA Platform. Developer's Manual
Vaadin web applications framework. HTML / CSS / JavaScript. Java Servlets. This manual and other documentation related to the CUBA platform can be...
Read more >
chameleon | Customizable honeypots for monitoring network traffic
However chameleon build file is not available. ... and move the following annotations to it: - @Push from net.cbsolution.chameleon.ui.views.AlertView.
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