angular-cli: ERROR TypeError: Cannot read property 'subscribe' of undefined

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting(I believe bug, not 100% sure)
- [ ] feature request

Versions.

ng version 1.4.4 node: 8.4.0 os: darwin x64

Repro steps.

here is my repo to the code: Repo

I was running just fine and I have looked into trying to solve the issue. Here is the link to my Stack Overflow Question: Stack Overflow

I did not run any commands other than ng serve.

The log given by the failure.

Error in the console that came (also in the stack question):

UnlockComponent.html:81 ERROR TypeError: Cannot read property 'subscribe' of undefined
    at UnlockComponent.webpackJsonp.../../../../../src/app/unlock/unlock.component.ts.UnlockComponent.unlock (unlock.component.ts:252)
    at Object.eval [as handleEvent] (UnlockComponent.html:81)
    at handleEvent (core.es5.js:12023)
    at callWithDebugContext (core.es5.js:13493)
    at Object.debugHandleEvent [as handleEvent] (core.es5.js:13081)
    at dispatchEvent (core.es5.js:8615)
    at core.es5.js:9226
    at HTMLButtonElement.<anonymous> (platform-browser.es5.js:2651)
    at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
    at Object.onInvokeTask (core.es5.js:3881)
ERROR CONTEXT 
DebugContext_ {view: {…}, nodeIndex: 120, nodeDef: {…}, elDef: {…}, elView: {…}}
component
:
(...)
componentRenderElement
:
(...)
context
:
(...)
elDef
:
{index: 120, parent: {…}, renderParent: {…}, bindingIndex: 12, outputIndex: 6, …}
elOrCompView
:
(...)
elView
:
{def: {…}, parent: {…}, viewContainerParent: null, parentNodeDef: {…}, context: UnlockComponent, …}
injector
:
(...)
nodeDef
:
{index: 120, parent: {…}, renderParent: {…}, bindingIndex: 12, outputIndex: 6, …}
nodeIndex
:
120
providerTokens
:
(...)
references
:
(...)
renderNode
:
(...)
view
:
{def: {…}, parent: {…}, viewContainerParent: null, parentNodeDef: {…}, context: UnlockComponent, …}
__proto__
:
Object

I have looked a number of times to find if the issue was spelling or camel casing…no avail.

Mention any other details that might be useful.

This Error was not present before today. I haven’t had any issues with this until today.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15

Most upvoted comments

worked around with a different solution

What was your solution?

having the same problem here when testing

TypeError: Cannot read property ‘subscribe’ of undefined