Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'table' of undefined #1984

Closed
probert94 opened this issue Mar 13, 2019 · 4 comments
Closed

Cannot read property 'table' of undefined #1984

probert94 opened this issue Mar 13, 2019 · 4 comments
Labels
bug Something isn't working flow
Projects

Comments

@probert94
Copy link

Since vaadin/vaadin-grid-flow#515 and vaadin/vaadin-grid-flow#516 have been closed, I opened a new issue, as the problem persists in some cases.

I am using a Grid inside the content of the Vaadin App Layout Add-on.
I set verticalScrollingEnabled to false for this Grid, which results in an error, if the Grid is displayed immediately after the page is loaded.
Stacktrace:

Uncaught TypeError: Cannot read property 'table' of undefined
    at Object.grid.$connector.setVerticalScrollingEnabled (gridConnector.js:854)
    at Object.eval (eval at jt (client-28831013082792340517B7074033EF04.cache.js:975), <anonymous>:3:15)
    at jt (client-28831013082792340517B7074033EF04.cache.js:975)
    at it (client-28831013082792340517B7074033EF04.cache.js:931)
    at gt (client-28831013082792340517B7074033EF04.cache.js:562)
    at Pq (client-28831013082792340517B7074033EF04.cache.js:482)
    at lr.mr [as W] (client-28831013082792340517B7074033EF04.cache.js:983)
    at eA (client-28831013082792340517B7074033EF04.cache.js:866)
    at pv (client-28831013082792340517B7074033EF04.cache.js:976)
    at Zw.$w [as J] (client-28831013082792340517B7074033EF04.cache.js:983)
    at Function.yl (client-28831013082792340517B7074033EF04.cache.js:983)
    at d (client-28831013082792340517B7074033EF04.cache.js:640)
    at Set.forEach (<anonymous>)
    at bl (client-28831013082792340517B7074033EF04.cache.js:740)
    at HTMLElement.s.ready (client-28831013082792340517B7074033EF04.cache.js:983)
    at HTMLElement._enableProperties (properties-changed.html:321)
    at HTMLElement.connectedCallback (properties-mixin.html:219)
    at HTMLElement.connectedCallback (element-mixin.html:595)
    at nv (client-28831013082792340517B7074033EF04.cache.js:941)
    at Fv (client-28831013082792340517B7074033EF04.cache.js:902)
    at Gx.Hx [as W] (client-28831013082792340517B7074033EF04.cache.js:983)
    at eA (client-28831013082792340517B7074033EF04.cache.js:866)
    at Rq (client-28831013082792340517B7074033EF04.cache.js:978)
    at fr.gr [as D] (client-28831013082792340517B7074033EF04.cache.js:983)
    at Bj (client-28831013082792340517B7074033EF04.cache.js:409)
    at Jq (client-28831013082792340517B7074033EF04.cache.js:979)
    at Kq (client-28831013082792340517B7074033EF04.cache.js:963)
    at Ki (client-28831013082792340517B7074033EF04.cache.js:670)
    at eo (client-28831013082792340517B7074033EF04.cache.js:738)
    at ho (client-28831013082792340517B7074033EF04.cache.js:611)
    at lo.mo [as D] (client-28831013082792340517B7074033EF04.cache.js:983)
    at Ob (client-28831013082792340517B7074033EF04.cache.js:930)
    at Hb (client-28831013082792340517B7074033EF04.cache.js:655)
    at Rb.Sb [as C] (client-28831013082792340517B7074033EF04.cache.js:983)
    at Mb (client-28831013082792340517B7074033EF04.cache.js:194)
    at sb (client-28831013082792340517B7074033EF04.cache.js:413)
    at vb (client-28831013082792340517B7074033EF04.cache.js:850)
    at client-28831013082792340517B7074033EF04.cache.js:592
    at d (client-28831013082792340517B7074033EF04.cache.js:687)

Steps to reproduce:

  1. Download the Vaadin Project Base for Vaadin 13
  2. Add the app-layout-addon to the dependencies in the pom.xml:
    <dependency>
        <groupId>com.github.appreciated</groupId>
        <artifactId>app-layout-addon</artifactId>
        <version>2.0.8</version>
    </dependency>
  1. Copy the following code into MainView.java
public class MainView extends AppLayoutRouterLayout {
    public MainView() {
        init(AppLayoutBuilder.get(Behaviour.LEFT_RESPONSIVE)
            .withTitle("Test")
            .withAppMenu(LeftAppMenuBuilder.get().add(new Span("Navigation")).build()).build()
        );
    }

    @Route(value = "", layout= MainView.class)
    public static class GridContent extends VerticalLayout {

        public GridContent() {
            Grid<Object> grid = new Grid<>();
            grid.setVerticalScrollingEnabled(false);
            add(grid);
        }
    }
}
  1. Run the project
@denis-anisimov
Copy link

Confirmed.

@probert94
Copy link
Author

It seems like the ready-function should be executed, before the initLazy-function of the gridConnector, but if you refresh the page the initLazy might be executed before the ready-function, which causes the error.

@urkl
Copy link

urkl commented Nov 4, 2019

I have exactly the same bug in my application. Please try to fix it.

@vaadin-bot vaadin-bot transferred this issue from vaadin/vaadin-grid-flow Oct 6, 2020
@vaadin-bot vaadin-bot added bug Something isn't working flow labels Oct 6, 2020
@probert94
Copy link
Author

As this problem didn't occur for quite a while, I am going to close this issue.
Not sure if it is solved or if it just disappeared cause we are not using the app-layout-addon anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flow
Projects
No open projects
vaadin-core
  
📬  Inbox
Development

No branches or pull requests

4 participants