Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in Cannot read property 'length' of undefined #5051

Closed
moniuch opened this issue Feb 27, 2017 · 11 comments
Closed

ERROR in Cannot read property 'length' of undefined #5051

moniuch opened this issue Feb 27, 2017 · 11 comments

Comments

@moniuch
Copy link

moniuch commented Feb 27, 2017

This is a very unhelpful error message. The page seems to momentarily load and then the failure comes up. Please improve the message so that it's easier to figure out the source of the error.

Hash: a4321a331991d1327504                                                            
Time: 12625ms
chunk    {0} main.bundle.js, main.bundle.js.map (main) 161 kB {2} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.bundle.js.map (styles) 19.5 kB {3} [initial]
chunk    {2} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.78 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry]

ERROR in Cannot read property 'length' of undefined

Stack

errors	@	client?17b0:109
sock.onmessage	@	socket.js:37
EventTarget.dispatchEvent	@	eventtarget.js:51
(anonymous)	@	main.js:274
SockJS._transportMessage	@	main.js:272
EventEmitter.emit	@	emitter.js:50
WebSocketTransport.ws.onmessage	@	websocket.js:35
wrapFn	@	zone.js:698
ZoneDelegate.invokeTask	@	zone.js:265
Zone.runTask	@	zone.js:154
ZoneTask.invoke	@	zone.js:335

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
32.3 [25.5]
angular 2.4.4

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
can't really pin down, the error started to apear after a massive rebase

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

@RicardoVaranda
Copy link
Contributor

Hi @moniuch, Would you be able to give us the repro steps for this issue?

@moniuch
Copy link
Author

moniuch commented Feb 27, 2017

@RicardoVaranda I wish I could be helpful here but... As I mentioned - it all happened after a massive rebase. Even if I was able to provide my codebase, it wouldn't be even possible to tell where the problem originated, as it was a side-effect of a sequence. I surprisingly could go pass it by rebooting the ng serve process, but it does not change the overall purpose of this ticket - to ask for a more helpful message - as per what was the code or the object that turned to be undefined.

@RicardoVaranda
Copy link
Contributor

Hey @moniuch, I understand your frustration and completely agree that it should give a more in depth error message to give us developers something more to work with.

This issue is seems very similar to another issue being tracked here:
#5053

@elvisbegovic
Copy link
Contributor

Better message error output !

I agree!

@filipesilva
Copy link
Contributor

Dupe of #5053

@renjit00
Copy link

renjit00 commented Jun 2, 2017

I got the same issue...how to resolve this please reply anyone resolved the issue
ANDROID_HOME=C:\Users\name\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_102

Error: Cannot read property 'length' of undefined

@angular/cli: 1.0.0
node: 6.9.1
os: win32 ia32
@angular/common: 4.0.2
@angular/compiler: 4.0.2
@angular/compiler-cli: 4.0.2
@angular/core: 4.0.2
@angular/forms: 4.0.2
@angular/http: 4.0.2
@angular/platform-browser: 4.0.2
@angular/platform-browser-dynamic: 4.0.2

@moniuch
Copy link
Author

moniuch commented Jun 2, 2017

@renjit00 I have been hit by this error a bunch of times. I discovered that it helped to keep calm and reboot ng serve.

@MrVibe
Copy link

MrVibe commented Jun 7, 2017

Facing the same error, I do not know how to resolve it. I am working on a very big project and the error message does not even give a clue on which typescript file to look into. Already spent days into this, hopeless :(

@nitinsr013
Copy link

Facing the same error when I try to build ionic cordova build android.
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build android (exit code 1):

    ANDROID_HOME=C:\Users\....\AppData\Local\Android\sdk
    JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_101
    Error: Cannot read property 'length' of undefined

@arumuganainar73
Copy link

how can i fix this? please help me
ANDROID_HOME=C:\Users........\AppData\Local\Android\sdk1
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Cannot read property 'length' of undefined

[ERROR] An error occurred while running cordova run android (exit code 1).

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
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

8 participants