-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dart2js with package js crash #26322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In case you haven't figured it out already, it appears that the issue is that you need to add () to your annotation ( |
Oops. Reopening to track the better error message |
This is a general issue with annotations in Dart2JS and Dart. I think the most user friendly solution is to have |
Created #26840 to track your language-change request. |
this is handled by the CFE now. |
a@LinL460:/tmp/jstest/web$ dart2js main.dart -o main.dart.js
main.dart:12:2:
Error: A metadata annotation must be either a reference to a compile-time constant variable or a call to a constant constructor.
Try using a different constant value or referencing it through a constant variable.
@js
^^
main.dart:12:1:
Internal Error: Invalid @js(...) annotation.
@js
^^^
The compiler is broken.
When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.
The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.
Please include the following information:
Ubuntu 16.04
1.15.0
below as well as the source location above).
The compiler crashed: Internal Error: Invalid @js(...) annotation.
#0 _CompilerDiagnosticReporter.internalError (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1963)
#1 JsInteropAnnotationHandler.validate (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/patch_parser.dart:514)
#2 EagerAnnotationHandler.checkAnnotation. (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/patch_parser.dart:431)
#3 _CompilerDiagnosticReporter.withCurrentElement (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1753)
#4 ResolutionEnqueuer.emptyDeferredTaskQueue (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/enqueue.dart:885)
#5 ResolutionEnqueuer.onQueueEmpty (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/enqueue.dart:878)
#6 Enqueuer.forEach (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/enqueue.dart:708)
#7 Compiler.emptyQueue (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1117)
#8 Compiler.processQueue (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1145)
#9 Compiler.compileLoadedLibraries (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:1013)
#10 Compiler.runInternal. (file:///tmp/tmpla4aZL/dart-1.15.0/dart/pkg/compiler/lib/src/compiler.dart:884)
#11 _RootZone.runUnary (dart:async/zone.dart:1137)
#12 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:551)
#13 _Future._propagateToListeners (dart:async/future_impl.dart:637)
#14 _Future._completeWithValue (dart:async/future_impl.dart:424)
#15 _Future._asyncComplete. (dart:async/future_impl.dart:479)
#16 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#17 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#18 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#19 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)
The text was updated successfully, but these errors were encountered: