Skip to content

MatTree can not be created in es6 #11580

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
zonkhonk opened this issue May 30, 2018 · 5 comments · Fixed by #12556
Closed

MatTree can not be created in es6 #11580

zonkhonk opened this issue May 30, 2018 · 5 comments · Fixed by #12556
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@zonkhonk
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Should work in es6

What is the current behavior?

Throw following error

ERROR TypeError: Cannot read property 'find' of undefined
at MatTree.ngOnInit (tree.js:484)
at checkAndUpdateDirectiveInline (core.js:11866)
at checkAndUpdateNodeInline (core.js:13394)
at checkAndUpdateNode (core.js:13337)
at debugCheckAndUpdateNode (core.js:14246)
at debugCheckDirectivesFn (core.js:14191)
at Object.eval [as updateDirectives] (TreeCheckListComponent.html:1)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:14180)
at checkAndUpdateView (core.js:13303)
at callViewAction (core.js:13654)

What are the steps to reproduce?

use an example from angular/material
(https://material.angular.io/components/tree/examples)
and change the compiler target to "es6" in tsconfig.json

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"dependencies": {
"@angular/animations": "^6.0.3",
"@angular/cdk": "^6.2.0",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/material": "^6.2.0",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@angular/router": "^6.0.3",
"core-js": "^2.5.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^6.0.3",
"@angular-devkit/build-angular": "~0.6.5",
"typescript": "~2.7.2",
"@angular/cli": "~6.0.5",
"@angular/language-service": "^6.0.3",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
}

Is there anything else we should know?

the "_differs" constructor parameter of CdkTree is "undefined" at runtime

@zonkhonk zonkhonk changed the title MatTree can not create in es6 MatTree can not be created in es6 May 30, 2018
@amreshprasad
Copy link

I am facing this as well. Had the tree working under es5, but switched the target to es6 and started getting this error.

@chipallen2
Copy link

Getting this as well. I upgraded to the latest 6.3.0 version but it still happens in there too.

@Talador12
Copy link

Talador12 commented Jul 25, 2018

I am facing this as well. Had the tree working under es5, but switched the target to es6 and started getting this error.

Same here.

es6, es2017, and es2018 all do not work. This is a serious issue.

@tinayuangao @josephperrott any thoughts?

@liunan
Copy link

liunan commented Aug 1, 2018

This can works in production mode

@josephperrott josephperrott added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Aug 6, 2018
@josephperrott josephperrott self-assigned this Aug 6, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants