2
votes

I just upgraded to polymer: ^1.0.0-rc.10 with a dependecy_overrides of reflectable ^0.5.0.

I observed that whenever I upgraded a project with the above polymer and reflectable I get the following line in the output

Error on line 1, column 1 of https://pub.dartlang.org/api/packages/initialize: Invalid description: "test_package" is a relative path, but this isn't a local pubspec.

Attempting to run my application fails with the following error

"P:\Program Files\Dart\dev\dart-sdk\bin\pub.bat" serve web --port=56435
Loading source assets...
Loading web_components, reflectable and test/pub_serve transformers...
Serving epimss_polymer_app web on http://localhost:56435
Build error:
Transform WebComponents on epimss_polymer_app|web/index.html threw error: Class 'LibraryElementImpl' has no instance getter 'node'.

NoSuchMethodError: method not found: 'node'
Receiver: Instance of 'LibraryElementImpl'
Arguments: []
dart:core-patch/object_patch.dart 42                 Object._noSuchMethod
dart:core-patch/object_patch.dart 45                 Object.noSuchMethod
package:initialize/transformer.dart 240              _BootstrapFileBuilder._readAnnotations
package:initialize/transformer.dart 213              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 193              _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 551                      _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 637                      _Future._propagateToListeners
dart:async/future_impl.dart 424                      _Future._completeWithValue
dart:async/future_impl.dart 479                      _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 41                _microtaskLoop
dart:async/schedule_microtask.dart 50                _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 96             _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 149            _RawReceivePortImpl._handleMessage

dart:core                                            Object.noSuchMethod
package:initialize/transformer.dart 240              _BootstrapFileBuilder._readAnnotations
package:initialize/transformer.dart 213              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 209              _BootstrapFileBuilder._readLibraries
package:initialize/transformer.dart 193              _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>
[web] GET index.html => Could not find asset epimss_polymer_app|web/index.html.
[Info from Reflectable on epimss_polymer_app|ReflectableTransformed]:
Ignoring entry point my_project.web.index that does not include the class `Reflectable`.
Build completed with 1 errors.

Run pub cache repair but error remains.

Any suggestion as to how best to correct the issue please.

EDIT 1

I have narrowed down the problem to be caused by either web_component, reflectable or polymer.

I created a new polymer-app with stage-hand and the application runs.

The new polymer-app pubspec.yaml is shown below:

name: 'ui_tester'
version: 0.0.1
description: A web app built using polymer.dart.
#author: Your Name <[email protected]>
#homepage: https://www.example.com

environment:
  sdk: '>=1.9.0 <2.0.0'

dependencies:
  browser: ^0.10.0
  polymer_elements: ^1.0.0-rc.1
  polymer: ^1.0.0-rc.10
  reflectable: ^0.5.0
#  polymer: ^1.0.0-rc.9
#  reflectable: ^0.4.0
  web_components: ^0.12.1

transformers:
- web_components:
    entry_points: web/index.html
- reflectable:
    entry_points: web/index.bootstrap.initialize.dart
- $dart2js:
    $include: '**/*.bootstrap.initialize.dart'
    minify: true
    commandLineOptions:
    - --trust-type-annotations
    - --trust-primitives

As soon as I change the dependencies to reflectable: 0.5.0 and polymer: ^1.0.0-rc.10 from 0.40 and 1.0.0.rc9 (commented lines) respectively the problem is reproduced consistently.

I am suggesting that there might a bug here.

I also noticed that stage-hand now uses

transformers:
- reflectable:
    entry_points: web/index.bootstrap.initialize.dart

instead of

transformers:
- reflectable:
    entry_points: web/index.dart

Are the codes similar in what they do?

Cheers

1
If the package versions were supposted to be compatible, you probably wouldn't need a dependency override. Why do you use the dependency override?Günter Zöchbauer
It is necessary to allow another 3rd-party package to work.st_clair_clarke
I guess you need to notify the maintainer of the 3rd party package to make it compatible with the new version of reflectable. I wasn't able yet to make the simplest Polymer application work with rc.10 yet anyway (I created some issues)Günter Zöchbauer
Good. Your attempts confirmed what was happening to me.st_clair_clarke

1 Answers

2
votes

update

Current workaround - delete .pub directory - run pub upgrade (error message still shown) - limit the analyzer to version 0.27.1 (no 0.26.x or 0.27.1+1 versions)

orig

I'm not sure if it's a pub issue as well because it's about a dev_dependency. I created issue https://github.com/dart-lang/initialize/issues/43 in the initialize package to fix the pubspec.yaml.