Uh oh!
There was an error while loading. Please reload this page.
fix: material not working with ES2015 - #13709
Conversation
Fixes that Angular Material cannot be used with ES2015. See angular#12760 for detailed information. We already had a workaround applied, but this improves the workaround because it only partially worked for classes where no attributes were defined. Fixesangular#13695.
06c06dd to
bf6c06fCompare| import {MAT_ACCORDION, MatAccordionBase} from './accordion-base'; | ||
| // TODO(devversion): workaround for https://github.com/angular/material2/issues/12760 | ||
| export const _CdkAccordionItem = CdkAccordionItem; |
There was a problem hiding this comment.
does this one need the ctorParameters forwarding?
There was a problem hiding this comment.
It no longer needs the workaround because there is an explicit constructor for the MatExpansionPanel class now.
epelc
commented
Oct 25, 2018
@devversion are you sure this works? I'm getting the same error with material and cdk 7.0.1 |
devversion
commented
Oct 25, 2018
@epelc Pretty confident. I've confirmed it locally when submitting the PR. Also this fix isn't part of v7.0.1. Can you please check with |
epelc
commented
Oct 25, 2018
@devversion Is there a way to install master easily with npm? |
devversion
commented
Oct 25, 2018
@epelc Yeah you could do |
epelc
commented
Oct 25, 2018
@devversion Thanks I'll try it out. I think your fix didn't make it into 7.0.1 looking at the git history now |
devversion
commented
Oct 25, 2018
@epelc Awesome. Thanks! and yeah, exactly. The fix is not part of |
epelc
commented
Oct 25, 2018
@devversion Yeah my bad I realized cmd+f some old similar fix in the change log once 7.0.1 came out. I'm not sure if this is just me but I got a different error about ctor parameters when testing with master. Looks like it's trying to call NOTE this line works a bunch but at some point it gets passed an anonymous function which obvisouly doesn't have a map method since it's not an array(I just set a breakpoint for I looked into it a bit and I think it might be something to do with maybe these anon functions not being called or something? I don't have it setup to test and I know little about this ctor/compilation bugs inner workings so might be easier you to checkout? |
devversion
commented
Oct 25, 2018
Thanks for checking that out. I'm not sure what's different in your scenario, but I can see why this "could" fail. I will push some safety changes to a PR tomorrow. Thanks again. |
Also while you're at it, where is the code you shared in the second screenshot located? Are those constants defined within a class? |
It was if you click the Here is a larger screenshot that may help Also my testing repo with exactly what I'm using(standard cli project + basic table + target=es2015) https://github.com/epelc/bad-material-table Let me know if you need any other info to help or if I can do anything. |
devversion
commented
Oct 25, 2018
I see, these are the reflection capabilities from Angular core. This definitely helps. Thanks again. Also regarding just assigning the I will have a look tomorrow. Will keep you updated. At first glance, it just looks like the |
sishbi
commented
Oct 27, 2018
Is there a timeline for when this fix will get into a release? |
DenysVuika
commented
Oct 28, 2018
Trying to upgrade an application to 7.0.2, and got hundreds of unit tests now failing with |
Thanks for the report. Should be fixed soon. See #13834. Technically only things that previously didn't work either, should throw such an error. Are you using ES2015? Edit: Actually after thinking about it again. It can also happen now if you don't use one of the given components with ES2015 because Angular always tries to read the metadata. Previously it would have just errored if you bootstrap a given component within ES2015. |
DenysVuika
commented
Nov 7, 2018
@devversion we are blocked by two releases already. Just upgraded to 7.0.3 and this damn thing (sorry) keeps failing with |
sishbi
commented
Nov 7, 2018
If you downgrade the target version in the tsconfig.json to es5 it works, which is what I did... |
@DenysVuika Sorry, but unfortunately applying workarounds led to other problems which aren't really solvable in a way that still keeps the workaround in an acceptable way. Since the whole issue is actually an Angular bug that will be fixed with angular/angular@95743e3 (so upcoming Angular cc. @jelbourn for thoughts. |
knoefel
commented
Nov 26, 2018
Still not working after upgrade to 7.1! |
devversion
commented
Nov 26, 2018
Yeah, there are still some issues with |
CreepyGnome
commented
May 13, 2019
What is the status of Angular Material working with ES2015? Issue angular/angular#27267 shows it was fixed by angular/angular#29232. That last one was closed fixed almost 2 months ago. This has become a blocker as if you need to use a feature that requires es2015 (ie Map and iterate features of it) you cannot because enabling this breaks Angular Material. |
nhhockeyplayer
commented
May 17, 2019
I am unable to use mat-sidenav I switched my target I thought it was safe to bump target to es2018 |
actually I upgraded to latest angular and typescript and everything works with es2018 adios es5 and babel some good feedback team is doing an awesome job... angular with ngrx on rxjs rules typescript is the real deal |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |



Fixes that Angular Material cannot be used with ES2015. See #12760 for detailed information. We already had a workaround applied, but this improves the workaround because it only partially worked for classes where no attributes were defined.
Fixes#13695.