forked from firka/flutter
Initialize dartLoader.rootDirectories so the Web stack trace mapper can convert package source paths (#160383)
See https://dart.googlesource.com/sdk/+/refs/heads/main/pkg/dev_compiler/web/stack_trace_mapper.dart Fixes https://github.com/flutter/flutter/issues/158109
This commit is contained in:
@@ -1033,6 +1033,7 @@ class WebDevFS implements DevFS {
|
||||
entrypoint: entrypoint,
|
||||
nullAssertions: nullAssertions,
|
||||
nativeNullAssertions: nativeNullAssertions,
|
||||
loaderRootDirectory: _baseUri.toString(),
|
||||
),
|
||||
);
|
||||
// TODO(zanderso): refactor the asset code in this and the regular devfs to
|
||||
|
||||
@@ -458,6 +458,7 @@ String generateMainModule({
|
||||
required bool nullAssertions,
|
||||
required bool nativeNullAssertions,
|
||||
String bootstrapModule = 'main_module.bootstrap',
|
||||
String loaderRootDirectory = '',
|
||||
}) {
|
||||
// The typo below in "EXTENTION" is load-bearing, package:build depends on it.
|
||||
return '''
|
||||
@@ -481,7 +482,7 @@ define("$bootstrapModule", ["$entrypoint", "dart_sdk"], function(app, dart_sdk)
|
||||
child.main();
|
||||
|
||||
window.\$dartLoader = {};
|
||||
window.\$dartLoader.rootDirectories = [];
|
||||
window.\$dartLoader.rootDirectories = ["$loaderRootDirectory"];
|
||||
if (window.\$requireLoader) {
|
||||
window.\$requireLoader.getModuleLibraries = dart_sdk.dart.getModuleLibraries;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user