Public/Anonymous View does not work

I have created a public view (which should be displayed, even no user is autheticated), consisting of TextField, Grid and a menu. However during tesing the UI works, but after deployment the view does not work instead I get a lot of errors of this kind:

Uncaught (in promise) TypeError: can't access property "setFooterRenderer", this.$connector is undefined
    anonymous https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js line 3 > Function:3
    anonymous https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js line 3 > Function:3
    jE https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    cp https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    y0 https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:1
    dm https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:1
    gb https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    lo https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    FE https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    D https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    _c https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:1
    wp https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    Xg https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    o3 https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    FE https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    D https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    oo https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:1
    fb https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    J https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3
    k3 https://app.domain.com/VAADIN/build/FlowClient-DyMGXbet.js:3

I already changed a lot of things in my SecurictyConfig without luck. What can be the reason, that a view annotated with
@Route(value = “share/view”)
@AnonymousAllowed
does not work?

I am frustated, I know the error must be in the SecurityConfig of the application, but I do not know why.

Florian.

Seems like the logic that creates an optimized production bundle doesn’t detect that the JavaScript for Grid should be included in the bundle. Do you use the Grid directly from the class with the @Route annotation or is there some indirection in between?

You could try setting optimizeBundle to false in the configuration for the Maven or Gradle plugin to see if that has an impact.

Hi,
thank you for the quick reponse. The problem also occurs when I set the access of this view to @PermitAll. When I call the view using the url I come to the login view, enter my correct credentials and then it redirects me to the view, as expected. But the view does not shwo any “complex” elements, it shows the header consisting of an H3 element and the footer. For any more complex elements like the MenuBar, I get an similiar error as posted.

That’s strange. I usually use an AppLayout, but for this views I do not. Might that be the problem?

The view uses the setParameter() method to load certain data from the database.

I use the same grid component also in the AppLayout, is a grid which shows file and folders I get from a repository.

Florian

Did you test with the optimizeBundle setting?

Thank you,
this helped me! The error must be in the compilation process. After I compiled with optimizeBundle = false I realized that the whole frontend has been created new. I think there was the error. Because I already reverted to optimizeBundle = true but decided to completly regernate the whole frontend and the error disappeard.

Thank you!
Florian