dart-archive / angular.dart

Legacy source repository. See github.com/dart-lang/angular
https://webdev.dartlang.org/angular/
1.25k stars 248 forks source link

Error while `pub build`ing angular dart app. #1635

Closed austincummings closed 9 years ago

austincummings commented 9 years ago

Here is the error I am getting. I posted this on the mailing list but have not gotten a response yet. Was hoping someone here could help me.

$ pub build
Loading source assets...
Loading di/module_transformer and smoke/src/default_transformer transformers...
Loading angular transformers...
Building angular_app... (11.2s)
Build error:
Transform _Serial on angular_app|web/main.dart threw error: must be a string literal: SimpleIdentifier
package:angular/tools/source_metadata_extractor.dart 219:5          assertString
package:angular/tools/source_metadata_extractor.dart 133:41         DirectiveMetadataCollectingAstVisitor.visitClassDeclaration.<fn>.<fn>
dart:collection/list.dart 63                                        Object&ListMixin.forEach
package:angular/tools/source_metadata_extractor.dart 128:38         DirectiveMetadataCollectingAstVisitor.visitClassDeclaration.<fn>
dart:collection/list.dart 63                                        Object&ListMixin.forEach
package:angular/tools/source_metadata_extractor.dart 119:27         DirectiveMetadataCollectingAstVisitor.visitClassDeclaration
package:analyzer/src/generated/ast.dart 3358:62                     ClassDeclaration.accept
package:analyzer/src/generated/ast.dart 18872:26                    NodeList.accept
package:analyzer/src/generated/ast.dart 4125:27                     CompilationUnit.visitChildren
package:analyzer/src/generated/ast.dart 13782:23                    RecursiveAstVisitor.visitCompilationUnit
package:analyzer/src/generated/ast.dart 4075:61                     CompilationUnit.accept
package:angular/tools/source_metadata_extractor.dart 205:14         DirectiveMetadataCollectingVisitor.call
dart:collection/iterable.dart 227                                   IterableBase.forEach
package:angular/tools/transformer/expression_generator.dart 155:17  _LibrarySourceCrawler.crawl
package:angular/tools/source_metadata_extractor.dart 27:24          SourceMetadataExtractor.gatherDirectiveInfo
package:angular/tools/transformer/expression_generator.dart 43:52   ExpressionGenerator.applyResolver
package:code_transformers/src/resolvers.dart 113:44                 Transformer&ResolverTransformer.applyToEntryPoints.<fn>.<fn>
dart:async/future.dart 118                                          Future.Future.<fn>
dart:async-patch/timer_patch.dart 12                                Timer._createTimer.<fn>
dart:io/timer_impl.dart 292                                         _handleTimeout
dart:isolate-patch/isolate_patch.dart 130                           _RawReceivePortImpl._handleMessage

package:angular/tools/source_metadata_extractor.dart 219:5          assertString
package:angular/tools/source_metadata_extractor.dart 133:41         DirectiveMetadataCollectingAstVisitor.visitClassDeclaration.<fn>.<fn>
dart:collection                                                     Object&ListMixin.forEach
package:angular/tools/source_metadata_extractor.dart 128:38         DirectiveMetadataCollectingAstVisitor.visitClassDeclaration.<fn>
dart:collection                                                     Object&ListMixin.forEach
package:angular/tools/source_metadata_extractor.dart 119:27         DirectiveMetadataCollectingAstVisitor.visitClassDeclaration
package:analyzer/src/generated/ast.dart 3358:62                     ClassDeclaration.accept
package:analyzer/src/generated/ast.dart 18872:26                    NodeList.accept
package:analyzer/src/generated/ast.dart 4125:27                     CompilationUnit.visitChildren
package:analyzer/src/generated/ast.dart 13782:23                    RecursiveAstVisitor.visitCompilationUnit
package:analyzer/src/generated/ast.dart 4075:61                     CompilationUnit.accept
package:angular/tools/source_metadata_extractor.dart 205:14         DirectiveMetadataCollectingVisitor.call
dart:collection                                                     IterableBase.forEach
package:angular/tools/transformer/expression_generator.dart 155:17  _LibrarySourceCrawler.crawl
package:angular/tools/source_metadata_extractor.dart 27:24          SourceMetadataExtractor.gatherDirectiveInfo
package:angular/tools/transformer/expression_generator.dart 43:52   ExpressionGenerator.applyResolver
package:code_transformers/src/resolvers.dart 113:44                 Transformer&ResolverTransformer.applyToEntryPoints.<fn>.<fn>
dart:isolate                                                        _RawReceivePortImpl._handleMessage

Built 231 files to "build".
austincummings commented 9 years ago

I found the issue. I was using a const String as my selector name in the @Component annotation. Which the transformer expects to be a literal string.