Closed floitschG closed 8 years ago
From @zoechi on July 3, 2016 13:31
Can you please share the minimal code that allows to reproduce? How does the entry_point transformer configuration look like?
From @HannesRammer on July 3, 2016 22:27
I only created new dart project in intellij using polymer app example code.
From @zoechi on July 4, 2016 6:33
How did you create it? What are the exact steps. How does the entry point config look like in pubspec.yaml
?
From @HannesRammer on July 5, 2016 11:0
In intelliJ
Uncaught Unhandled exception: Bad state: Reflectable has not been initialized. Did you forget to add the main file to the reflectable transformer's entry_points in pubspec.yaml?
----------START pubspec.yaml-------------- name: 'untitled' version: 0.0.1 description: A web app built using polymer.dart.
environment: sdk: '>=1.9.0 <2.0.0'
dependencies: browser: ^0.10.0 polymer_elements: ^1.0.0-rc.8 polymer: ^1.0.0-rc.15 web_components: ^0.12.0 analyzer: ">=0.27.0 <0.27.2" reflectable: "^0.5.2"
transformers:
From @eernstg on July 5, 2016 14:29
That kind of reporting is much more actionable, thanks a lot!
I've worked on reflectable but not directly on polymer, so I'll give my 2 cents from that point of view.
I cannot reproduce the 'Reflectable has not been initialized' exception (I think I've followed your description at every step, and it just works at step 10 here, with no need to add any dependencies). But I can give you a bit of information about the situation where you will get that exception:
Essentially, 'Reflectable has not been initialized' means that the initialization code for reflectable has not been executed, and then the first attempt to use the compile-time database which enables the mirror features offered by reflectable will fail with that exception. It does not have to happen immediately: your application might not use mirrors at all for a while. One way this can happen is if you are using reflectable directly, requesting reflectable as a transformer in pubspec.yaml, and then forgetting to specify your application as an entry point.
In this case you are using polymer, however, and this means that the reflectable transformer is not needed in pubspec.yaml. Polymer has its own transformer which imports the reflectable transformer as code (among others), so only the polymer transformer should be in pubspec.yaml, and it will pass on its entry points to reflectable.
I'm sure @jakemac53 has more specific input on how the problem you described could arise, and what to do about it (and possibly placing this issue on polymer rather than sdk), but this should at least give you some background.
From @HannesRammer on July 3, 2016 1:16
I just created a new project with polymer sample code, and I have to add the reflectable package to make it run, so i thought maybe it would make sense to add them directly on generation
I am on windows 10 insider dart stable 17.1
intellij 2016.1.3 environment: sdk: '>=1.9.0 <2.0.0'
this is my pubspec dependency list
dependencies: browser: ^0.10.0
polymer_elements: ^1.0.0-rc.8 polymer: ^1.0.0-rc.15 web_components: ^0.12.0 analyzer: ">=0.27.1 <0.27.2" #I needed to add this since im on win10 reflectable: "^0.5.2" #I need to add this line else I get the error msg below
Uncaught Unhandled exception: Bad state: Reflectable has not been initialized. Did you forget to add the main file to the reflectable transformer's entry_points in pubspec.yaml?
Copied from original issue: dart-lang/sdk#26820