Skip to content

Bug: TypeError in SbbTable due to undefined _ngZone #1158

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

Closed
scito opened this issue Feb 17, 2022 · 6 comments
Closed

Bug: TypeError in SbbTable due to undefined _ngZone #1158

scito opened this issue Feb 17, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@scito
Copy link

scito commented Feb 17, 2022

Describe the bug

I get in core.mjs:6495

ERROR TypeError: Cannot read properties of undefined (reading 'runOutsideAngular')
    at SbbTable.ngOnInit (table.mjs:838:22)
    at callHook (core.mjs:2533:22)
    at callHooks (core.mjs:2502:17)
    at executeInitAndCheckHooks (core.mjs:2453:9)
    at selectIndexInternal (core.mjs:8424:17)
    at Module.ɵɵadvance (core.mjs:8407:5)
    at ErfassteAntraegeComponent_sbb_table_wrapper_0_table_1_Template (erfasste-antraege.component.html:237:25)
    at executeTemplate (core.mjs:9637:9)
    at refreshView (core.mjs:9503:13)
    at refreshEmbeddedViews (core.mjs:10628:17)

My code is working with 13.0.0, but not with version 13.1.0 or 13.5.0

It seems _ngZone does not exist anymore in SbbTable (table.ts) and was replaced with ngZone. But _ngZone is still used in line 130 of table.ts.

The issues seems to come in commit 5ffe939 of issue #1019.

This error is triggered by

<tr sbb-header-row *sbbHeaderRowDef="displayedColumns; sticky: true"></tr>

Expected behavior
No TypeError

@scito scito added the bug Something isn't working label Feb 17, 2022
@jeripeierSBB
Copy link
Collaborator

Hi @scito

this is probably cdk related. Which cdk version do you use?

@scito
Copy link
Author

scito commented Feb 17, 2022

@jeripeierSBB
"@angular/cdk": "^13.0.2",

@kyubisation
Copy link
Collaborator

We recommend also updating the CDK with our library, as documented in our how to update guide.
In this case, it is because this problem was fixed in angular/components#24202 by @jeripeierSBB, which was released with https://github.com/angular/components/releases/tag/13.1.3

Can you check whether updating the CDK fixes the problem?

@jeripeierSBB
Copy link
Collaborator

Angular cdk introduced an unintentional breaking change, which we in the meanwhile corrected with a PR at angular cdk. So there are a little range of versions which do not work together. Please update cdk to the latest version and the problem should be gone. Normally it‘s best practice to update cdk and library together, because we guarantee support always with the latest version. You can also consult our update guide on how its done best and convenient. https://angular.app.sbb.ch/howtoupdate

Please close the issue if your problem is solved or reach out to us again. Thanks :)

@scito
Copy link
Author

scito commented Feb 17, 2022

I updated Angular to 13.2.2 and all libs. It is working now again.
Thanks for your help.

@scito scito closed this as completed Feb 17, 2022
@kyubisation
Copy link
Collaborator

Thanks for the feedback.
Feel free to open another Issue, if you encounter another problem or have a question. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants