You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running pub run build_runner (serve | build) I got an error, but not which import is wrong. Instead:
[SEVERE] Build: Failed after 1m 50s
NoSuchMethodError: The getter 'stringValue' was called on null.
Receiver: null
Tried calling: stringValue
#0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1 _missingImportMessage.<anonymous closure> (package:build_modules/src/errors.dart:94:35)
#2 Iterable.firstWhere (dart:core/iterable.dart:584)
#3 _missingImportMessage (package:build_modules/src/errors.dart:93:56)
<asynchronous suspension>
#4 MissingModulesException.create (package:build_modules/src/errors.dart:76:21)
<asynchronous suspension>
#5 Module.computeTransitiveDependencies (package:build_modules/src/modules.dart:141:43)
I debugged to the line package:build_modules/src/errors.dart:94 and found out the creation of the correct Exception was interrupted. uri of PartOfDirectiveImpl is null and stringValue can't be invoked.
Future<String> _missingImportMessage(
AssetId sourceId, AssetId missingId, AssetReader reader) async {
var contents =await reader.readAsString(sourceId);
var parsed =parseDirectives(contents, suppressErrors:true);
var import =
parsed.directives.whereType<UriBasedDirective>().firstWhere((directive) {
// directive = PartOfDirectiveImpl "part of project.serializables.site_page;"// uri = nullvar uriString = directive.uri.stringValue;
if (uriString.startsWith('dart:')) returnfalse;
var id =newAssetId.resolve(uriString, from: sourceId);
return id == missingId;
}, orElse: () =>null);
var lineInfo = parsed.lineInfo.getLocation(import.offset);
return'`$import` from $sourceId at $lineInfo';
}
```dart
The text was updated successfully, but these errors were encountered:
Dart SDK Version [ 2.0.0-dev.32.0 ]
Package [ build_modules 0.2.0+1 ]
System [ windows_x64 ]
I use json_serializable to generate a part file with toJson and fromJson methods. To reproduce the error I inserted one missing import:
When running pub run build_runner (serve | build) I got an error, but not which import is wrong. Instead:
I debugged to the line package:build_modules/src/errors.dart:94 and found out the creation of the correct Exception was interrupted. uri of PartOfDirectiveImpl is null and stringValue can't be invoked.
The text was updated successfully, but these errors were encountered: