Skip to content

Commit 89af242

Browse files
natebiggsCommit Queue
authored andcommitted
[ddc] Append hot restart instruction to hot reload rejection reasons.
By adding this message here, any entrypoint that makes use of this for hot reload (e.g. DartPad, Flutter tools/FE server) will all surface this same message. This probably easier than having each one try to detect errors and append its own message. Change-Id: I5980d530b66da818e29403cc13407095d8b203dd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408380 Reviewed-by: Mark Zhou <[email protected]> Commit-Queue: Nate Biggs <[email protected]> Reviewed-by: Johnni Winther <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]>
1 parent 89e545c commit 89af242

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pkg/dev_compiler/lib/src/command/command.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ Future<CompilerResult> _compile(List<String> args,
374374
lastAcceptedComponent, compiledLibraries);
375375
if (rejectionReasons.isNotEmpty) {
376376
throw StateError(
377-
'Hot reload rejected due to:\n${rejectionReasons.join('\n')}');
377+
'Hot reload rejected due to:\n${rejectionReasons.join('\n')}\n'
378+
'Use hot restart instead.');
378379
}
379380
}
380381
var sink = File(reloadDeltaKernel).openWrite();

pkg/frontend_server/lib/src/javascript_bundle.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ class IncrementalJavaScriptBundler {
9090
// connected component graph.
9191
final List<String> errors = _deltaInspector.compareGenerations(
9292
lastFullComponent, partialComponent);
93-
if (errors.isNotEmpty) throw new Exception(errors.join('/n'));
93+
if (errors.isNotEmpty) {
94+
throw new Exception(errors.join('/n') +
95+
'\nHot reload rejected due to unsupported changes. '
96+
'Use hot restart instead.');
97+
}
9498
}
9599
_currentComponent = partialComponent;
96100
_updateFullComponent(lastFullComponent, partialComponent);

0 commit comments

Comments
 (0)