test icon indicating copy to clipboard operation
test copied to clipboard

Web tests crash on load in 2.19 dev sdks

Open jakemac53 opened this issue 2 years ago • 3 comments

Originally this issue surfaced in the build repo, where we run regular tests against bleeding edge of the SDK.

Tried running normal web tests here as well (cd pkgs/test && dart compile js tool/host.dart -o lib/src/runner/browser/static/host.dart.js --minify -O0 && dart run test -p chrome --pause-after-load) and I see the same problem.

The issue is in host.dart. It appears that the object we get back from Url.queryParameters is not a Map as expected.

Note that I only see the issue here if the host.dart file is recompiled. I am not sure exactly why package:build reproduces the issue without that, but maybe it is recompiling the host.dart file automatically as a part of the build (although I am not aware of such behavior).

jakemac53 avatar Aug 29 '22 15:08 jakemac53

cc @joshualitt in case this is related to the static interop changes, also @rakudrama for general dart2js support.

jakemac53 avatar Aug 29 '22 15:08 jakemac53

I am getting "PlainJavascriptObject" as the runtime type of queryParameters but I expect a map, this is the output when I added the following prints:

  print(_currentUrl);
  print(_currentUrl.queryParameters);
  print(_currentUrl.queryParameters.runtimeType);
  print(_currentUrl.queryParameters.keys);
  print(_currentUrl.queryParameters.values);
  print(_currentUrl.queryParameters.entries);
  print(_currentUrl.queryParameters['debug']);

image

jakemac53 avatar Aug 29 '22 15:08 jakemac53

Note that we realized this also only reproduces if you pass --minify and -O0 flags, which seems to suggest it is timing related.

jakemac53 avatar Aug 29 '22 17:08 jakemac53