Skip to content

build_runner-precompiled tests fail to load in test 1.32.0 #2766

Closed

Description

@greglittlefield-wf

When using test 1.32.0, tests fail to load when using build_runner test or dart run test --precompiled:

% dart run build_runner test
...
00:00 +0 -1: loading test/simple_test.dart [E]
  Failed to load "test/simple_test.dart": Failed to load script at http://localhost:56407/AcDQNcKo4-Y=/test/simple_test.dart.browser_test.dart.js.

The compiled JS file exists in the build output, but something goes wrong when loading it.

This also reproduces when using dart run test --precompiled directly:

% ./tool/precompile_and_test.sh
+ BUILD_OUTPUT=build_output
+ dart run build_runner build -o test:build_output
...
Built with build_runner/aot in 17s; wrote 1694 outputs.

+ JS_FILE=build_output/simple_browser_test.dart.browser_test.dart.js
+ '[' '!' -f build_output/simple_browser_test.dart.browser_test.dart.js ']'
+ echo '==> Compiled JS found: build_output/simple_browser_test.dart.browser_test.dart.js'
==> Compiled JS found: build_output/simple_browser_test.dart.browser_test.dart.js

+ dart run test --precompiled build_output
Building package executable... (2.6s)
Built test:test.
00:00 +0 -1: loading test/simple_browser_test.dart [E]
  Failed to load "test/simple_browser_test.dart": Failed to load script at http://localhost:57474/_kkR2lMeqzw=/test/simple_browser_test.dart.browser_test.dart.js.

To run this test again: /Users/greglittlefield/.asdf/installs/dart/3.13.4/dart-sdk/bin/dart test test/simple_browser_test.dart -p chrome --plain-name 'loading test/simple_browser_test.dart'
00:00 +0 -1: Some tests failed.

This issue does not reproduce when using test 1.31.2. Pinning to that old version changes only the following packages, and appears to work around the issue:

< test 1.31.2 (was 1.32.0) (1.32.0 available)
< test_api 0.7.13 (was 0.7.14) (0.7.14 available)
< test_core 0.6.19 (was 0.6.20) (0.6.20 available)

This issue seemed like it could also be reported to github.com/dart-lang/build, but since it seemed like a regression in test packages, starting here made sense to me.

Activity

  1. jakemac53 commented on Sep 22, 2026

    @jakemac53
    Contributor

    Most likely a result of #2724 - I thought I did a quick manual test of that but maybe not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions