Skip to content

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

Description

@schultek

When running dwds in aot mode (e.g. dart install webdev) the injected client loading fails due to the following lines not working correctly:

final uri = await Isolate.resolvePackageUri(
Uri.parse('package:$_clientScript.js'),
);
if (uri == null) {
throw StateError('Cannot resolve "package:$_clientScript.js"');
}

This causes the following error when running webdev serve and trying to load the website:

GET /dwds/src/injected/client.js
Error thrown by handler.
Bad state: Cannot resolve "package:dwds/src/injected/client.js"
package:shelf/shelf_io.dart 91                   serveRequests
package:webdev/src/util.dart 25                  serveHttpRequests.<fn>
package:stack_trace                              Chain.capture
package:webdev/src/util.dart 24                  serveHttpRequests
package:webdev/src/serve/webdev_server.dart 300  WebDevServer.start

@bkonyi

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions