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

Unreadable error message when a module is missing #5568

Closed
mgol opened this issue Dec 29, 2013 · 45 comments
Closed

Unreadable error message when a module is missing #5568

mgol opened this issue Dec 29, 2013 · 45 comments

Comments

@mgol
Copy link
Member

mgol commented Dec 29, 2013

Chrome clips long error messages with no way to get to their full text making most Angular "unfound dependency" messages completely useless. An example I stumbled upon now:

Uncaught Error: [$injector:modulerr] Failed to instantiate module mgol due to:
Error: [$injector:modulerr] Failed to instantiate module mgolCatchLinks due to:
Error: [$injector:modulerr] Failed to instantiate module mgolRoute due to:
Error: [$injec...<omitted>...1)
@CWSpear
Copy link
Contributor

CWSpear commented Dec 29, 2013

I've never seen <omitted> before. Can you click on it to expand it at all? Are you using the dev (unminified) or the production (minified) version of the code?

@mgol
Copy link
Member Author

mgol commented Dec 29, 2013

@CWSpear This text is not clickable. I've just checked that the problem doesnt' exist in Chrome stable (31) but it has existed in Canary for a long time now, not sure if it's going to land in 32 or 33.

I'm using the non-minified Angular version.

@CWSpear
Copy link
Contributor

CWSpear commented Dec 29, 2013

@mzgol Strange. I see it, too on Canary. You should open a bug with Blink/Chromium/Canary/Chrome or whomever you need to on that end, as that seems like it may be a bug/unintended (or otherwise should be reversed).

@IgorMinar
Copy link
Contributor

Can someone file a bug with chromium please and cross-reference it here. I wonder if this is intentional change or not.

@mgol
Copy link
Member Author

mgol commented Jan 7, 2014

@tbosch tbosch modified the milestones: 1.2.12, 1.2.11, 1.2.13 Feb 3, 2014
@btford btford modified the milestones: 1.2.14, 1.2.13 Feb 15, 2014
@IgorMinar IgorMinar modified the milestones: 1.3.0-beta.1, 1.2.14 Mar 1, 2014
@mgol
Copy link
Member Author

mgol commented Mar 3, 2014

Note: the change has already propagated to Chrome stable, now the clipped message is unavoidable. :(

@btford btford modified the milestones: 1.3.x, 1.3.0-beta.1 Mar 4, 2014
@bman654
Copy link

bman654 commented Mar 10, 2014

workaround: http://stackoverflow.com/a/22218280/674326

@mlegenhausen
Copy link

+1

1 similar comment
@nfroidure
Copy link

👍

@IgorMinar
Copy link
Contributor

I can't repro this any more. Was this reverted from Chrome?

@granteagon
Copy link
Contributor

I'm not seeing this in Canary, but still seeing it on normal Chrome. Not sure about the details. However, at least in my case the error is even less helpful than the <omitted> error. It's just saying "uncaught object" now instead of at least the angular module that erred.

@jrencz
Copy link

jrencz commented Apr 9, 2014

👍

In canary 36 it's still there.

@ivandotv
Copy link

Also clipped in Chrome Version 34.0.1847.116 on linux

@TimothyKrell
Copy link

Still a problem for me in 36.0.1967.0 Canary.

@boneskull
Copy link
Contributor

Still issue in 36.0.1984.1 canary

@clouddueling
Copy link
Contributor

My console just says 'Uncaught object'.

This is happens when a module is missing as a dependency. No module name I just have to guess modules until the error goes away.

AngularJS 1.2.16
Chrome 35.0.1916.114 Normal
Mac OSx 10.9.2

Check the console:
http://jsfiddle.net/mzSpD/

@clouddueling
Copy link
Contributor

In the unminified script, line 82 I added console.error(message);
screen shot 2014-05-22 at 4 47 53 pm

The error message in my console.
screen shot 2014-05-22 at 4 44 16 pm

IMO I think having the error output in my console and have the link for errors.angularjs.org would be a great improvement unless something happens I'm not aware of.

@edgarnadal
Copy link

Seems to be fixed on Version 37.0.2008.2 canary

@caitp
Copy link
Contributor

caitp commented May 30, 2014

Hmm, I can't reproduce it in 37.0.2020.0 (Official Build 273468) or a content_shell I built today.

With stable chrome, I can't seem to write a failing test case for this, although I do see the error in practice. It's not easy to tell what the error actually refers to, though, since the message which causes the Error constructor to throw is quite large, and trying to narrow it down isn't working so well yet.

So, maybe this is something that will just fix itself in the not too distant future (since it's working well in Canary). maybe we should just leave it, unless you can put together a failing test case for us (It doesn't seem to be coming from <CR><LF> characters, colons, quotes, unix linefeeds, or anything else special --- it's really not clear what is causing the issue)

@Igosuki
Copy link

Igosuki commented May 30, 2014

@caitp There is a Chrome thread here https://code.google.com/p/chromium/issues/detail?id=331971

It apparently got fixed in Canary (v37) and it was due to buggy code for traces with more than 256 characters -> https://codereview.chromium.org/271733005/patch/1/10001

So I fear the problem will persist until Canary makes it as the main release

@caitp
Copy link
Contributor

caitp commented May 30, 2014

@adriatic no need to worry about a reproduction, I see what the issue is.

This is, as has been pointed out, a browser bug which has since been fixed. I don't think there is much benefit fixing this in core

@adriatic
Copy link

OK, I got too dependent on Chrome, it seems. The stack trace on Firefox correctly explains the cause of the failure (misspelled module name in this case)

@clouddueling
Copy link
Contributor

I opened my jsfiddle in Firefox and I get the error link now instead of Uncaught object

@adriatic
Copy link

I verified all other browsers and they all correctly show the complete stack trace - nit just Firefox. As @caitp stated above, we need to wait for Canary if we depend on Chrome in Angular development.

@Igosuki
Copy link

Igosuki commented May 30, 2014

However, this would be a good opportunity to print clearer stack traces when it comes to module names... (the actual error should come first)

@adriatic
Copy link

That would certainly be my take - as the current "Uncaught Object" error message has caused two orders higher waste of time than the time it would take to put in a temporary replacement for Chrome's stack trace formatting.

Being an Angular novice, this specific behavior has caused me days and days of grief :-)

@clouddueling
Copy link
Contributor

+1 @adriatic and @Igosuki

@nmabhinandan
Copy link

Same here in 1.2!

@charlie-s
Copy link

+1 @adriatic for "days of grief". Canary (v37) works well.

@adriatic
Copy link

adriatic commented Jun 1, 2014

I have no doubt that Canary works well (at least in the context we are discussing here :-). The fact that this "Uncaught Object" is a known problem for nearly a year and that nobody (in Angular team) found the time and need to put in a patch for this issue is what doesn't work well. I had so many people respond to my explanation of this problem I posted at Pluralsight site that it's pretty clear I was not alone suffering with this.

This is not a big issue on a more global scale, it is just my deep conviction that the customer is always right (customer = developer in this case) that kept me from just ignoring it once I found what I need to do to go around it.

@arobbins
Copy link

arobbins commented Jun 1, 2014

I was experiencing the same bug. After testing in Canary, I noticed I had a typo in my Gruntfile.

To everyone still experiencing this, try running your code in Canary. It gave me a more verbose log.

@ifyify
Copy link

ifyify commented Jun 5, 2014

Upgrade from beta.7 to beta.10 (nothing else changed).
Chrome Version 35.0.1916.114 (Stable)

Same error
Uncaught object angular.js:78
(anonymous function) angular.js:78
(anonymous function) angular.js:3914
forEach angular.js:320
loadModules angular.js:3875
createInjector angular.js:3815
doBootstrap angular.js:1476
bootstrap angular.js:1491
angularInit angular.js:1403
(anonymous function) angular.js:22554
jQuery.Callbacks.fire jquery.js:3099
jQuery.Callbacks.self.fireWith jquery.js:3211
jQuery.extend.ready jquery.js:3423
completed jquery.js:3453

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.10/angular.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.10/angular-route.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.10/angular-sanitize.js"></script>

@jrencz
Copy link

jrencz commented Jun 5, 2014

Please check out latest Chrome Canary. It's already fixed there. All we have to do is to wait or to start developing on unstable releases what have other advantages as well like latest changes in the dev tools ;)

@thecheryl
Copy link

This was happening to me in Chrome 35.0.1916.153. I tried Canary 37.0.2058.2 and it worked (i.e. I got a better log message). Thanks for the info.

@mikekidder
Copy link

When Angular 1.2.x added the ngMinErr utility, this Chrome issue really started to see light of day.
Really surprised its taken this long to fix, looking forward to when it makes its way into stable branch

@byeval
Copy link

byeval commented Jul 8, 2014

@ifyify +1,I also got this error message, have u fixed it?
Uncaught object angular.js:78
(anonymous function) angular.js:78
(anonymous function) angular.js:3979
forEach angular.js:324
loadModules angular.js:3940
createInjector angular.js:3880
doBootstrap angular.js:1504
bootstrap angular.js:1519
angularInit angular.js:1431
(anonymous function) angular.js:22856
trigger angular.js:2650

@adriatic
Copy link

adriatic commented Jul 8, 2014

As suggested by several people in this thread (myself included) the best solution is to download the Chrome Canary (from https://www.google.com/intl/en/chrome/browser/canary.html) and use it instead of your current version of Chrome.

@byeval
Copy link

byeval commented Jul 8, 2014

@adriatic thank u!

@fijimunkii
Copy link

Thanks @adriatic

@Narretz
Copy link
Contributor

Narretz commented Sep 19, 2014

This was fixed in Chrome 36

@Narretz Narretz closed this as completed Sep 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests