-
Notifications
You must be signed in to change notification settings - Fork 50
Illegal invocation calling window.getComputedStyle #135
Comments
maybe this is caused by angular v.12.2.x. I have the same problem, after updating angular version |
I have the same problem, after updating from Angular 11.2.5 to 12.2.0. |
Solved it by using this hack. Install this package "replace-in-file", `const replace = require('replace-in-file'); try { Then add a new command to package.json Use it before the build I think the issue is caused because Angular 12 uses another minifier, that is "Terser", before it was Uglify i think. |
It is caused by 12.2.0. It was fine with 12.1.4. |
I encountered the same issue when migrating to 12.2.5. @CaerusKaru, @alan-agius4 have you seen this issue ? For information: Tested with all other packages set to 12.2.5 |
I have the same issue after migration to latest angular |
Can confirm downgrading back to 12.1.4 solves the issue for me now, waiting for an update |
Seems like "Preboot" is not maintained anymore |
any news about this issue? |
Does anyone have a minimal reproduction we can investigate? We're in the process of cleaning up the repo and bringing it up to date, but it's hard to say what the issue is here without a firm reproduction. |
Minimal reproduction: https://github.com/jakubsobel/angular12-preboot-issue |
any updates on this ? |
Having the same issue here on |
@CaerusKaru any update about this issue? |
I submitted a fix in this PR: #146 Let's hope it will be checked soon by @CaerusKaru as this error is also blocking for Angular 13 migration |
do you have any updates about this issue? can @jsaguet 's PR be merged? |
Problem still present in Angular 13 @boban984 's replace script did not solve it, it does not contain the same replacement as PR #146 . This is an updated version of the script: fix_minify.js:
Took a while. for me to figure out, but after installing this script, you need to clear an Angular build cache:
After that, it worked for me (confirming #146 will provide the fix) |
I can confirm that #146 and webberig's comment resolved the issue in my case. |
any update about this issue? |
I dont have problem with angular 13, can you test it again? what function do you call? |
ok I see the problem now, basicly, the preboot canot useable sorry to say that |
I removed preboot from my project as I used it only for fixing page flickering. Seems it doesn't actively maintained and instead of applying workarounds I just implemented my own solution for showing overlay. The idea is pretty simple: app.module.ts
|
Good that really nice, i will try it |
It's unclear how this is related to Angular versions, it is illegal to call getComputedStyle() with
Perhaps this code path wasn't being hit at all before? In any case, I hope the PR can be merged soon. In the mean time, it is pretty easy to apply the fix and build the package yourself (just edit lib/package.json for your package name, run |
@pavelrazuvalau your work is great, I used in my production build and it very smoooooooooooooooooooooooooooooooth |
any news about this issue? |
Can you explain the logic behind this? I have tried integrating the same, however post-deployment it fails to work. It works on local serving however. |
it basicly do the same as preboot do:
tested on https://awread.vn using angular 14 |
Beautiful |
I included the PrebotModule in an Angular 12 project and I found that the following line breaks, because the call to
getComputedStyle
is Illegal.preboot/src/lib/api/event.replayer.ts
Line 146 in 022ce61
The
getComputedStyle
object is set here:preboot/src/lib/api/event.replayer.ts
Line 21 in 022ce61
What is the current behavior?
Currently it throws an error and breaks the swapping of the root application.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem by
What is the expected behavior?
Should not fail when running in the browser. I would suggest to add
.bind(window)
to the declaration.Please tell us about your environment:
The text was updated successfully, but these errors were encountered: