Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

TypeError: Cannot read property 'annotations' of undefined #12

Closed
reutopiaer opened this issue Mar 27, 2015 · 12 comments
Closed

TypeError: Cannot read property 'annotations' of undefined #12

reutopiaer opened this issue Mar 27, 2015 · 12 comments

Comments

@reutopiaer
Copy link

f1ef6a8 error:
Uncaught (in promise) TypeError: Cannot read property 'annotations' of undefined {stack: (...), message: "Cannot read property 'annotations' of undefined"}

a5f4882 work fine

@reutopiaer reutopiaer changed the title Can't work with webcomponents.js(@version 0.5.5) TypeError: Cannot read property 'annotations' of undefined Mar 30, 2015
@reutopiaer
Copy link
Author

es6-shim.js:1 Uncaught RangeError: Maximum call stack size exceeded

<!doctype html>
<html>
   <head>
        <title>I</title>
        <script src="quickstart/dist/es6-shim.js"></script>
        <script src="bower_components/webcomponents.js/webcomponents.js"></script>  
  </head>
  <body>
  </body>
</html>

@reutopiaer reutopiaer reopened this Apr 1, 2015
@gattoo
Copy link

gattoo commented Apr 10, 2015

Same case for me while trying to build a todoApp.

TypeError: Cannot read property 'annotations' of undefined

TypeError: Cannot read property 'annotations' of undefined
    at ReflectionCapabilities.execute.$__export.annotations (http://localhost:8080/angular2/src/reflection/reflection_capabilities.js:83:40)
    at Reflector.execute.$__export.annotations (http://localhost:8080/angular2/src/reflection/reflector.js:81:50)
    at DirectiveMetadataReader.execute.$__export.read (http://localhost:8080/angular2/src/core/compiler/directive_metadata_reader.js:33:41)
    at http://localhost:8080/angular2/src/core/compiler/compiler.js:127:35
    at Array.map (native)
    at Function.execute.$__export.map (http://localhost:8080/angular2/src/facade/collection.js:178:26)
    at Compiler.execute.$__export.createSteps (http://localhost:8080/angular2/src/core/compiler/compiler.js:126:43)
    at Compiler.execute.$__export._compileTemplate (http://localhost:8080/angular2/src/core/compiler/compiler.js:164:53)
    at http://localhost:8080/angular2/src/core/compiler/compiler.js:154:29
    at Zone.run (http://localhost:8080/dist/es6-shim.js:29891:19)
application.js:109 Uncaught (in promise) TypeError: Cannot read property 'annotations' of undefined {stack: (...), message: "Cannot read property 'annotations' of undefined"}

@wannadream
Copy link

I ran into the same issue.


TypeError: Cannot read property 'annotations' of undefined
TypeError: Cannot read property 'annotations' of undefined at ReflectionCapabilities.execute.$__export.annotations 
(http://localhost:3456/quickstart/angular2/src/reflection/reflection_capabilities.js:81:40)
    at Reflector.execute.$__export.annotations (http://localhost:3456/quickstart/angular2/src/reflection/reflector.js:81:50)
    at DirectiveMetadataReader.execute.$__export.read (http://localhost:3456/quickstart/angular2/src/core/compiler/directive_metadata_reader.js:31:41)
    at http://localhost:3456/quickstart/angular2/src/core/compiler/compiler.js:127:35
    at Array.map (native)
    at Function.execute.$__export.map (http://localhost:3456/quickstart/angular2/src/facade/collection.js:172:26)
    at Compiler.execute.$__export.createSteps (http://localhost:3456/quickstart/angular2/src/core/compiler/compiler.js:126:43)
    at Compiler.execute.$__export._compileTemplate (http://localhost:3456/quickstart/angular2/src/core/compiler/compiler.js:164:53)
    at http://localhost:3456/quickstart/angular2/src/core/compiler/compiler.js:154:29
    at Zone.run (http://localhost:3456/quickstart/dist/es6-shim.js:29889:19)
application.js:255
Uncaught (in promise) TypeError: Cannot read property 'annotations' of undefined {stack: (...), message: "Cannot read property 'annotations' of undefined"}
message: "Cannot read property 'annotations' of undefined"
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: Error

@dicoy-zz
Copy link

same here: todoApp

@vicb
Copy link

vicb commented May 15, 2015

That's probably because an error in a View's directives, there is a PR pending on angular.
see angular/angular#1917

@artdias90
Copy link

Same problem

@pancanin
Copy link

Same here

@dwilt
Copy link

dwilt commented Jul 19, 2015

+1

@wardbell
Copy link
Contributor

Closed. Obsolete.

@FredLoney
Copy link

@wardbell this should be reopened. The error is an uncaught exception that occurs in several situations. For me, it occurs when a route is defined without a component declaration. The main issue is that the error message is useless and difficult to trace. In my case, it indirectly results from the resolve.ts code:

_ => resolver.resolveComponent(<any>node.value.component).then(factory => { node.value._resolvedComponentFactory = factory;

which cascades as an error in a wholly different call stack. The assignment above should be guarded by checking for a factory value and issuing the appropriate error. In addition, the route should be validated beforehand. Furthermore, there should be a separate task to ensure that the (forthcoming?) route documentation specifically states what is required.

This issue and its response are symptomatic of a pervasive cavalier disregard for defensive programming in the Angular development process. I appreciate how developers under pressure let issues like this slide, but technical leads and QA should know better. Code review, anyone? Unfortunately, defensive programming must be integral to the development process and is difficult to address after initial functional goals are achieved.

@filipesilva
Copy link
Contributor

@FredLoney the issue you are referring to should be reported in https://github.com/angular/angular rather than in the quickstart.

The quickstart repo aims to provide a barebones development environment and is not the place to report issues with Angular 2 itself.

@FredLoney
Copy link

Oops, I thought all Angular modules shared a common issues list.

Filed as Angular Issue #10168

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests