Skip to content
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

initializer is not a valid compile-time constant "static const expanded = OutputStyle._("expanded");" #2919

Closed
patriciovergaratobar opened this issue Nov 20, 2020 · 2 comments
Labels
type-question A question about expected behavior or functionality

Comments

@patriciovergaratobar
Copy link

  • Dart SDK Version Dart VM version: 2.0.0-dev.63.0 (Fri Jun 15 00:42:43 2018 +0200) on "windows_x64"
  • What package(s) build_runner 0.8.3
  • Windows
    When trying to compile or start my application with the command "webdev serve" I get the following error:

`

webdev serve

You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues

'package:sass/src/visitor/serialize.dart': error: line 1224 pos 27: initializer is not a valid compile-time constant
static const expanded = OutputStyle._("expanded");
^

Unhandled exception:
NoSuchMethodError: The getter 'isEmpty' was called on null.
Receiver: null
Tried calling: isEmpty
#0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1 new Trace.parse (package:stack_trace/src/trace.dart:120)
#2 CommandBase.runCore. (package:webdev/src/command/command_base.dart:101)
#3 _RootZone.runUnaryGuarded (dart:async/zone.dart:1316)
#4 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336)
#5 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263)
#6 _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:763)
#7 _StreamController._add (dart:async/stream_controller.dart:639)
#8 _StreamController.add (dart:async/stream_controller.dart:585)
#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
`

Does anybody know why?


For general questions consider using Stack Overflow instead:
https://stackoverflow.com/questions/tagged/dart

Also consider our Gitter channel for light-weight/quick discussions:
https://gitter.im/dart-lang/build


@jakemac53
Copy link
Contributor

It looks to me like you are on a very early days Dart 2 prerelease SDK that doesn't support omitting the const keyword within const contexts, so it would have to be explicitly const OutputStyle._("expanded"); in this case.

It is possible that your sass version has a bad lower bound sdk constraint, or maybe you are overriding it to select a version which is not compatible with your sdk.

@natebosch
Copy link
Member

Yeah this looks like there was a version of sass with an invalid SDK constraint - this was not too unusual during the -dev SDK releases. I'd recommend upgrading to a stable SDK and the latest compatible sass.

@natebosch natebosch added the type-question A question about expected behavior or functionality label Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-question A question about expected behavior or functionality
Projects
None yet
Development

No branches or pull requests

3 participants