-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
DDC-built Angular app not working in Chrome Canary #43193
Comments
Thanks @missvalentinep for filing this issue and for all the details in the original bug. We need to investigate more closely to see what's happening here. Please keep us posted too if you notice that this changes on the next canary release. |
@nshahan @Markzipan - could one of you take a closer look? I labeled P1 just in case this is something that will become a bigger problem once chrome releases the changes to beta/stable (like the issue we had with chrome 81). |
Thanks for reporting! This appears to be a much more general issue, as the error you described in your original bug is reproducible with Angular's Hello World app (on Canary):
We're continuing the investigation. |
interesting - could we be facing 2 different issues? The exception in this last comment appears to be affecting the dwds's client compiled with dart2js /cc @rakudrama @grouma Is the DDC issue reproducible with the hello world app if you run webdev with |
I'll dig in from the webdev side. The tracking similar issue is: dart-lang/webdev#1087 |
The bug disappears with |
@missvalentinep - do you have any pointers or an example you could provide for us to reproduce the |
This issue stems from Unless this is somehow a red herring. |
interesting... seems like a couple things to look into:
/cc @srujzs @rakudrama |
I can confirm that removing all instances of |
I don't think |
Yeah, that part's odd. Judging from the Chrome IDL (https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/core/timing/memory_info.idl#L35), MemoryInfo's constructor hasn't been exposed for a while now. Wonder why we're only seeing this issue now. |
@sigmundch the issue is reproducible in Tour of Heroes 2 - https://github.com/angular-examples/toh-2 (just in case - I'm using webdev 2.5.9 so I rose the What's interesting, that it's not reproduced in toh-1. Apparently, the second part adds some complexity that starts to cause the problem. |
…me API changes Chrome Canary no longer exposes window.performance.memory's constructor (it uses Object's instead). This hack lets (window.performance.memory is html.MemoryInfo) evaluate to true. See: #43193 Change-Id: I3c557467c3ea029052aba71f6695f4db0ec65515 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160782 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Mark Zhou <[email protected]>
@missvalentinep - @Markzipan landed e33f84d which should fix DDC after this chrome breaking change. Dart2js still needs more work, so this should only unblock the issue during development and with the For dart2js we need a very different fix. @rakudrama - can you share pointers to where we'd need to modify the caching of interceptors to detect that we are not accidentally caching anything on |
@sigmundch is there any way that this problem can be fixed in SDK 2.8? Not everyone is using the latest SDK version and moving to it so rapidly to get this fix can pretty be painful. |
@sigmundch I can confirm that the DDC fix also fixes the issue for Dart2JS (for the ToH sample). We can close after the SDK versioning is figured out. |
Awesome, thanks for following up @Markzipan ! For context @missvalentinep , we discovered that dart2js was working properly, but was tripping on a cascading issue caused by DDC's bug. There is a longer goal to prevent this kind of interference, but for now the fix we landed will be enough to address this problem altogether. Yay! I'll follow up on a cherry-pick request to get e33f84d on the current stable version. My understanding is that it will get to 2.9, but might not be possible to include it with 2.8. However, it is possible to workaround this by adding a couple lines of JavaScript in the page serving the application with practically the same logic as the change above: <script>
if (typeof window.MemoryInfo == "undefined") {
if (typeof window.performance.memory != "undefined") {
window.MemoryInfo = function () {};
window.MemoryInfo.prototype = window.performance.memory.__proto__;
}
}
</script> |
And here is the cherry-pick request: #43287 |
…me API changes Chrome Canary no longer exposes window.performance.memory's constructor (it uses Object's instead). This hack lets (window.performance.memory is html.MemoryInfo) evaluate to true. See: #43193 Change-Id: I3c557467c3ea029052aba71f6695f4db0ec65515 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160782 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Mark Zhou <[email protected]>
@sigmundch Is it possible that other class beside ´MemoryInfo´ had similar changes? Since upgrading to Chrome 87 I run into multiple strange issues when using DDC. With the above workaround I could resolve one of them, but there are more. I have some code like this: import 'dart:js' show context;
...
context['console'][type].apply([
'%c[$level] %c$name${message.contains('\n') ? ':\n' : ': '}%c$message',
'color: #9E9E9E',
'color: #${randomColor(name)}',
''
], thisArg: context['console']); This fails with:
Interesting is that this doesn't happen during the first calls to Even if I replace it with a simple |
@Fox32 sorry to hear you are seeing additional failures in Chrome 87. Do you know if this only relates to code that uses Let us know if you find more details as you investigate, and please feel free to open a new bug if you have some simple steps that we could use to reproduce the problem locally. |
@sigmundch The
Yeah we have some code from the time before you recommended it. Looks like it's time to migrate them to Thank you for taking a look! |
When opening in Chrome Canary my Angular app built with DDC I get this error and nothing works.
Full stack trace is available here.
No error is present when opening the same app in ordinary Chrome. Also, opening the app compiled with dart2js in Canary works, too.
I'm not sure who is responsible for this error - AngularDart, DarkSDK or Chrome Canary. I've created an issue in Angular repo but it seems to be a bit dead, so I'm writing to you guys.
Here is the link to the original issue - angulardart/angular#1905, it has a bit more info on what I've managed to find out myself.
The text was updated successfully, but these errors were encountered: