-
Notifications
You must be signed in to change notification settings - Fork 767
ES2015 support #950
Comments
Can you post a minimal reproduction repository for this? SSR issues are tough to debug unless we have the while picture. |
I am afraid that I can do that only after holidays. I can try to create a demo but my hopes are very low during the holidays sorry. |
Didn't notice this was a duplicate at first. Thanks for pointing out @CaerusKaru hopefully I added some helpful info in the other issue. Anyways @layyy you should be able to workaround for now if you can get the firebase project to target es5. |
@epelc No worries, it was non-obvious. Thanks for identifying the root cause, I'll work with Paul to track this down. |
Marking this as blocked on angular/angular#27267. Workaround for now is as @epelc said, use ES5. Alternatively, you could reimplement the directives using explicit constructors, and declare those instead. We're opting not to in order to cut down on complexity and breaking changes for people using custom breakpoints. |
I have similar issue #959. |
In my project for flex-layout I use this workaround from material. |
@dima11221122 Be advised that Material reverted that change, see here. The workaround may still work for you if you don't use Closure Compiler, but for those who do beware. |
At least for angular-cli projects it works properly:) |
Angular cli projects default to es5. I’m actually using an angular cli project but wanted to target es2015 instead. |
@CaerusKaru - Has this been fixed with @devversion UMD Build improvements ? |
@ThomasBurleson Nope, this is a deeper issue involving the Angular compiler |
fyi - for me this issue occurs for using flex layout v7.0.0-beta.24 with angular 7.2.15 (i.e. not just an angular 8 issue as suggested above). I had rolled back a failed ng 8 upgrade, but my tsconfig was still targeting es2015, and that's when this flex layout issue cropped up for me. I changed my tsconfig.json's back to targeting es5 and the issue cleared up in my dev build (ng build --dev). |
Having same issue as @epelc Using flex beta 26 and angular 8 And this is set in my prod build
Only solution I have found is to set Update: I set target to es5 in the tsconfig.json and build worked, but es2015 does not |
@CaerusKaru can we get this reopened? |
Same here, does not work when with
core.js:9110 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'init' of undefined
TypeError: Cannot read property 'init' of undefined
at DefaultLayoutDirective.init (core.js:463)
at new LayoutDirective (flex.js:176)
at new DefaultLayoutDirective (flex.js:188)
at core.js:9075
at NodeInjectorFactory.DefaultLayoutDirective_Factory [as factory] (flex.js:192)
at getNodeInjectable (core.js:8939)
at instantiateAllDirectives (core.js:15215)
at createDirectivesAndLocals (core.js:14611)
at ɵɵelementStart (core.js:19505)
at PresentationLayoutComponent_Template (template.html:18)
at resolvePromise (zone-evergreen.js:797)
at resolvePromise (zone-evergreen.js:754)
at zone-evergreen.js:858
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:34184)
at ZoneDelegate.invokeTask (zone-evergreen.js:390)
at Zone.runTask (zone-evergreen.js:168)
at drainMicroTaskQueue (zone-evergreen.js:559)
at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:469)
at invokeTask (zone-evergreen.js:1603)
core.js:7376 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'init' of undefined
TypeError: Cannot read property 'init' of undefined
at DefaultLayoutDirective.push../node_modules/@angular/flex-layout/__ivy_ngcc__/esm5/core.es5.js.BaseDirective2.init (core.es5.js:539)
at DefaultLayoutDirective.LayoutDirective [as constructor] (flex.es5.js:178)
at new DefaultLayoutDirective (flex.es5.js:193)
at core.js:7351
at NodeInjectorFactory.DefaultLayoutDirective_Factory [as factory] (flex.es5.js:197)
at getNodeInjectable (core.js:7254)
at instantiateAllDirectives (core.js:12015)
at createDirectivesAndLocals (core.js:11540)
at ɵɵelementStart (core.js:15419)
at PresentationLayoutComponent_Template (template.html:18)
at resolvePromise (zone.js:852)
at resolvePromise (zone.js:809)
at zone.js:913 |
All: this is an issue with Angular or the Angular CLI (my thought it the latter). Please direct all requests to those repositories, but feel free to link back to this issue. Keep in mind, this was never actually a Flex Layout issue, we just needed to wait for the requisite changes in the Angular compiler before we closed it since so many people encountered it with this library. |
Does anyone know if there is an open issue at the angular repo? |
@mfreirehfexp iirc there is an issue on the main angular repo. It's basically just waiting for ivy to release fully since it will fix this and the es2015 related compilation issues(ivy supports es2015). Sorry can't find the link but follow general ivy developments. |
@mfreirehfexp could you post link if you find it? @epelc thanks for the reply, it is my understanding ivy wont be released until Angular 9, so are you saying this will not be fixed until then? |
@spencerfontein Yeah, from my understanding we are waiting until angular 9 at least now(hopefully it's fully released for 9). You are pretty much SOL until then(forced to compile to different target) since ivy is still so early now(I've tried you just keep running into other bugs and isn't worth attempting yet). |
Thanks @epelc ! |
For those wondering, I changed all of my angular packages to be 8.2.0, or higher. Still not able to use flex-layout @CaerusKaru |
I'm also seeing this with CLI 8.2.0 with ivy enabled and target es2015 (flex-layout 8.0.0-beta.26). |
I'm having this error in CLI 8.2.3 with ivy enabled, flex-layout 8.0.0-beta.26. Switch off ivy could get my app run without error. But it would be nice to have ivy. |
@Enngage that issue was reported to |
There are some new updates related to Ivy in angular/angular#31956. |
I ran into this issue, but without Ivy enabled. The fix/workaround for me was to set "aot": true; along with "optimization": true and I kept the tsconfig target to ES2015. |
In relation to Ivy, this should be fixed in |
I was running into this error message without having opted into Ivy. My build command has |
@plurch thanks! I add |
You certainly want to avoid deploying to production if you have |
Could you provide more details? Do you mean performance issues or there are some security problems? For now I, seems to be, have no choice... I have empty error message with May be I'll try to update each dep manually, but is it worth it? I'm not sure, that this will help... |
@mohaxspb Performance is the primary concern. Both runtime and load time. You really should try to get your app building and working with AOT, otherwise it's not production ready. You can run Personally, I like to do If you run into problems, please feel free to create a StackOverflow question and then ping me on Gitter/Twitter and I can try to take a look. |
@Splaktar thanks for details! I'll try to update deps this week and write here about result) |
@Splaktar hello again! I tried to update, but it doesn't help. While updating with So there is a question on stackoverflow: It would be great if you find time to take a look at it! Anyway, thanks for helping, at least I managed deps updating) |
@Splaktar , at last I have error reason (SO user https://stackoverflow.com/users/10123947/shadow found it): there were attempt to change value of variable in template, defined in template with help of self-made directive. Problem here is in poor error message. Mentioned user received details only via debugging compiler (as I understand). There are some details https://stackoverflow.com/a/57981144/3212712. Same in Russian: https://ru.stackoverflow.com/a/1025417/17609 To get error message I have to edit
So I get this message:
With this info I can immediately find problem in code. UPD: I found a way to use my directive and do not ruin prod build. But this needs to edit compiler script here There is check for type of expression in template |
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. |
Bug Report
What is the expected behavior?
To make FlexLayoutServerModule work under firebase cloud function.
What is the current behavior?
Getting an error after successful deploy to a firebase.
What are the steps to reproduce?
functions/package.json
app.server.module.ts
error I am getting
The text was updated successfully, but these errors were encountered: