Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/import_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ class ImportResolver {
}
}

return null;
// No library in `libs` re-exports `element`. This can happen under
// build systems whose codegen resolvers expose a narrower library set
// than build_runner does — e.g. Bazel's rules_dart codegen action,
// which provides each transitive package's `src/` libraries but not
// their public re-exporting library. Without this fallback, callers
// (e.g. dependency_config_factory) end up emitting `import null;` for
// perfectly reachable types like StackedService.
//
// The element's own source URI is always a valid Dart import — it
// just points at a `src/` path rather than the public re-export.
// Generated code compiles and behaves identically. Prefer this over
// returning null, which strands the caller with no recoverable info.
return elementSourceUri.toString();
}

bool _isCoreDartType(Element? element) {
Expand Down