Skip to content

Fix DWDS injected client loading when running webdev in AOT mode#2768

Open
Varadraj75 wants to merge 1 commit intodart-lang:mainfrom
Varadraj75:fix-dwds-injected-client-aot
Open

Fix DWDS injected client loading when running webdev in AOT mode#2768
Varadraj75 wants to merge 1 commit intodart-lang:mainfrom
Varadraj75:fix-dwds-injected-client-aot

Conversation

@Varadraj75
Copy link
Copy Markdown

This PR fixes an issue where the DWDS injected debugging client fails to load when webdev is installed and run in AOT mode (for example via dart pub global activate).

In AOT snapshots, resolving the injected client using Isolate.resolvePackageUri can fail, leading to the runtime error:
Bad state: Cannot resolve "package:dwds/src/injected/client.js"

To address this, the injected DWDS client is now served using an AOT-safe approach, avoiding runtime package URI resolution and ensuring the client is always available when serving .bootstrap.js entrypoints.

This restores correct debugging behavior for globally activated webdev without affecting existing JIT or development workflows.
closes #2761


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Feb 1, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Varadraj75
Copy link
Copy Markdown
Author

Hey @nshahan, could you please review this PR when you get a chance?
Happy to make any changes or adjustments if needed—thanks!

@schultek
Copy link
Copy Markdown

@Varadraj75 Thanks for working on this. Seems like you need to sign the cla still.

Also since the client.js file is generated, make sure to also update the tool at dwds/tool/build.dart to generate the new dart file.

@nshahan
Copy link
Copy Markdown
Contributor

nshahan commented Mar 25, 2026

cc @jyameo
There is another attempt here to find a solution for running in AOT mode. What do you think about this approach?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dwds] [webdev] Loading injected client script fails in aot mode.

3 participants