dart-archive / web-components

Dart package providing the web components platform polyfills
https://pub.dartlang.org/packages/web_components
BSD 3-Clause "New" or "Revised" License
18 stars 10 forks source link

Class 'Parser' has no instance setter #44

Closed Hecatoncheir closed 8 years ago

Hecatoncheir commented 8 years ago

HI. I try update polymer from "^0.16.4" version, to '^1.0.0-rc.5', and after run pub serve I get an error:

Build error:
Transform WebComponents on no matter|web/index.html threw error: Class 'Parser' has no instance setter 'parseConditionalDirectives='.

NoSuchMethodError: method not found: 'parseConditionalDirectives='
Receiver: Instance of 'Parser'
Arguments: [true]
dart:core-patch/object_patch.dart 42                 Object._noSuchMethod
dart:core-patch/object_patch.dart 45                 Object.noSuchMethod
package:dart_style/src/dart_formatter.dart 104       DartFormatter.formatSource
package:dart_style/src/dart_formatter.dart 62        DartFormatter.format
package:initialize/transformer.dart 310              _BootstrapFileBuilder._buildNewEntryPoint
package:initialize/transformer.dart 195              _BootstrapFileBuilder.run
package:initialize/transformer.dart 35               generateBootstrapFile
package:web_components/build/web_components.dart 32  generateWebComponentsBootstrap
package:web_components/build/web_components.dart 82  WebComponentsTransformer.apply.<fn>.<fn>
dart:async/zone.dart 1149                            _RootZone.runUnary
dart:async/future_impl.dart 502                      _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 585                      _Future._propagateToListeners
dart:async/future_impl.dart 568                      _Future._propagateToListeners.handleWhenCompleteCallback.<fn>
dart:async/zone.dart 1149                            _RootZone.runUnary
dart:async/future_impl.dart 502                      _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 585                      _Future._propagateToListeners
dart:async/future_impl.dart 376                      _Future._completeWithValue
dart:async/future_impl.dart 430                      _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 43                _microtaskLoop
dart:async/schedule_microtask.dart 52                _microtaskLoopEntry
dart:isolate-patch/isolate_patch.dart 96             _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 151            _RawReceivePortImpl._handleMessage

dart:core                                            Object.noSuchMethod
package:dart_style/src/dart_formatter.dart 104       DartFormatter.formatSource
package:dart_style/src/dart_formatter.dart 62        DartFormatter.format
package:initialize/transformer.dart 310              _BootstrapFileBuilder._buildNewEntryPoint
package:initialize/transformer.dart 195              _BootstrapFileBuilder.run
package:initialize/transformer.dart 35               generateBootstrapFile
package:web_components/build/web_components.dart 32  generateWebComponentsBootstrap
package:web_components/build/web_components.dart 82  WebComponentsTransformer.apply.<fn>.<fn>

Dart sdk version what I use: Dart VM version: 1.13.2 (Tue Jan 5 06:49:57 2016) on "linux_x64"

pubspec.yaml:

name: no matter
version: 0.4.0
author: no matter
description: no matter
environment:
  sdk: '>=1.12.0 <2.0.0'

dependencies:
  bootjack: "0.6.5+3"
  browser: '>=0.10.0 <0.11.0'

  bwu_datagrid:
    git:
      url: 'https://github.com/bwu-dart/bwu_datagrid'
      ref: 'polymer1'

  polymer: '^1.0.0-rc.5'
  polymer_interop: '^1.0.0-rc.3'
  reflectable: '>=0.3.2 <0.3.4'
  web_components: '^0.12.0'

  route_hierarchical: "0.6.2"
  dquery: '>=0.7.1+1'
  di: ">=3.3.4 <4.0.0"
  firebase: "0.6.5+1"
  http: "0.11.3+3"
  unittest: '<=0.11.6+1'
  js: "^0.6.0"

dependency_overrides:
  analyzer: '>=0.26.0 <0.26.1+15'
  polymer:
    path: polymer-dart //from local folder
    version: '^1.0.0-rc.5'

transformers:
  - web_components:
      entry_points:
        - web/index.html
  - reflectable:
      entry_points:
        - web/spa.dart
  - $dart2js:
      minify: true
      commandLineOptions:
        - --trust-type-annotations
        - --trust-primitives
        - --enable-experimental-mirrors

I do all steps from Migration Guide. What was could happen?

jakemac53 commented 8 years ago

It looks like the error is actually coming from the dart_style package, where it is setting up the analyzers Parser with parseConditionalDirectives = true. My guess is this is a result of the dependency override on the analyzer, which is forcing a lower version than dart_style wants (which doesn't define that property).