Not sure if this is the appropriate place for this question, but when I simply updated my Angular script from 1.4.8 to 1.5.11, the UI bombs out and throws an error when attempting to do an angular.bootstrap(...):
https://code.angularjs.org/1.5.11/docs/error/$injector/modulerr?p0=ckwy4037000003e8twhn1wp0a&p1=Error: [$injector:modulerr] http://errors.angularjs.org/1.5.11/$injector/modulerr?p0=sn.common.attachments&p1=Error: [$injector:nomod] http://errors.angularjs.org/1.5.11/$injector/nomod?p0=sn.common.attachments
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:9:426
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:28:235
at b (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:27:282)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:28:20
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:17
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:34
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:9:426
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:292
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:43:34
at q (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:10:371)
at g (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:42:382)
at fb (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:46:381)
at c (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:24:19)
at Object.Gc [as bootstrap] (http://localhost:8080/scripts/angular_includes_1.5.11.jsx?v=Wed_Dec_08_12_09_54_PST_2021:24:332
...wondering if anyone else has come across this issue, and if they have an idea of what's going on?
I'm not really familiar with Angular, but from looking at the docs, when I compare between v1.4.8 and v1.5.11, the only difference I see is the two yellow banners - one in particular that says:
Note: Do not bootstrap the app on an element with a directive that
uses transclusion, such as ngIf, ngInclude and ngView. Doing this
misplaces the app $rootElement and the app's injector, causing
animations to stop working and making the injector inaccessible from
outside the app.
This looks related, but I'm not 100% certain that that may be...
Fixed in the comments:
Are you still providing sn.common.attachments, per your error URL?
you were right! It was a bad path (changed the version number in the path, but that path doesn't exist for that version)... Thank you!!!!
Angular employs a technique where its error messages are encoded as URLs, which enables more-informative and translatable error messages without bloating the production app size. Consequently, that first https://code.angularjs.org/ URL actually contains the real $injector:nomod error that the URL target describes. From there it's easier to see that the bootstrap failed due to the absence of a module, here sn.common.attachments specifically.
Related
We have developed a site using AngularJS 1.2.x version. The data to be displayed is got as a JSON and we have used angular expresions to populate these.
In the JSON response we have a URL in this format http://username#site.com. This is getting rendered properly in Chrome, FF. But in IE11 we are getting the following exception
Error: A security problem occurred.
at xa (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:124:230)
at Anonymous function (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:116:319)
at Anonymous function (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:116:319)
at Anonymous function (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:116:319)
at r (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:7:390)
at start (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:285:470)
at c (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:282:408)
at G (site/angularjs.d7ecc107a031818a8e5269a12c25ec8e.js:284:243)
at Anonymous
We found a similar question in(Angularjs with Internet Explorer 11, security issue) but the link provided in the accepted answer is no longer valid.
Is there any workaround to solve this issue?
I guess it's not possible, it's a security matter of IE and there's no workaround for that other than changing the url format to something IE accepts.
About the broken link, for some reason the english version of that article is not available anymore, but I've switched the locales in the url and managed to find other languages including pt-BR, pt-PT, es-ES and based on your profile hi-IN, if that doesn't work for you, you can try to Google Translate one of them to english or even try different lacale in the article url.
Those are the ones I tried and they're not broken:
Portuguese (Portugal) : pt-PT - https://support.microsoft.com/pt-pt/help/834489
Chinese (China) : zh-cn - https://support.microsoft.com/zh-cn/help/834489
Portuguese (Brazil): pt-BR - https://support.microsoft.com/pt-br/help/834489
Spanish (Spain): es-ES - https://support.microsoft.com/es-es/help/834489
Hindi (India): hi-IN - https://support.microsoft.com/hi-in/help/834489
Japanese (Japan): ja-jp - https://support.microsoft.com/ja-jp/help/834489
There ought to have more locales available but I'm not wiling to test all of them.
I'm trying to load an external page using JSONP, but the page is an HTML page, I just want to grab the contents of it using ajax.
EDIT: The reason why I'm doing this is because I want to pass all the user information ex: headers, ip, agent, when loading the page rather than my servers.
Is this doable? Right now, I can get the page, but jsonp attempts to parse the json, returning an error: Uncaught SyntaxError: Unexpected token <
Sample code:
$.post('http://example.com',function(data){
$('.results').html(data);
},'jsonp');
I've set up a jsfiddle for people to test with:
http://jsfiddle.net/8A63A/1/
http://en.wikipedia.org/wiki/JSONP#Script_element_injection
Making a JSONP call (in other words, to employ this usage pattern),
requires a script element. Therefore, for each new JSONP request, the
browser must add (or reuse) a new element—in other words,
inject the element—into the HTML DOM, with the desired value for the
"src" attribute. This element is then evaluated, the src URL is
retrieved, and the response JSON is evaluated.
Now look at your error:
Uncaught SyntaxError: Unexpected token <
< is the first character of any html tag, probably this is the start of <DOCTYPE, in this case, which is, of course, invalid JavaScript.
And NO, you can't use JSONP for fetching html data.
I have done what you want but in my case I have control of the server side code that returns the HTML.
So, what I did was wrapped the HTML code in one of the Json properties of the returned object and used it at client side, something like:
callback({"page": "<html>...</html>"})
The Syntax error you are facing it's because the library you're using expects json but the response is HTML, just that.
I've got three words for you: Same Origin Policy
Unless the remote URL actually supports proper JSONP requests, you won't be able to do what you're trying to. And that's a good thing.
Edit: You could of course try to proxy the request through your server …
If you really just want to employ the client to snag an HTML file, I suggest using flyJSONP - which uses YQL.. or use jankyPOST which uses some sweet techniques:
jankyPOST creates a hidden iframe and stuffs it with a form (iframe[0].contentWindow.document.body.form.name).
Then it uses HTML5 (watch legacy browsers!) webMessaging API to post to the other iframe and sets iframe's form elements' vals to what u specified.
Submits form to remote server...done.
Or you could just use PHP curl, parse it, echo it, so on.
IDK if what exactly ur using it for but I hope this helps.
ALSO...
I'm pretty sure you can JSONP anything that is an output from server code. I did this with ClientLogin by just JSONPing their keyGen page and successfully consoleLogged the text even though it was b/w tags. I had some other errors on that but point is that I scraped that output.
Currently, I'm trying to do what you are so I'll post back if successful.
I don't think this is possible. JSONP requires that the response is rendered properly.
If you want another solution, what about loading the url in an iframe and trying to talk through the iframe. I'm not 100% positive it will work, but it's worth a shot.
First, call the AJAX URL manually and see of the resulting HTML makes sense.
Second, you need to close your DIV in your fiddle example.
I'm porting some core angular stuff to a new project. Now I get injector errors but the stacktrace / angular error page does not show the classname of the offending injection errors. All I get is
Error: $injector:modulerr
Module Error
Usually there is a class name in there somewhere. Now I have to go through every single class (of dozens and dozens) and check the imports manually. Isn't there a better way? I've seen this happening while just adding classes. Sometimes it will show the name of the missing injection, sometimes it just comes up blank, when otherwise the stacktrace correctly identifies the missing/bad injection.
Is there some extra debug mode I can get at this information with?
The full (unuseful) stacktrace:
Failed to instantiate module FSApp due to:
Error: [$injector:modulerr] http://errors.angularjs.org/1.2.16/$injector/modulerr?p0=FSApp&p1=Error…cape%2Fmain%2Fresources%2Flib%2Fangular-1.2.16%2Fangular.min.js%3A32%3A445)
at Error (native)
at http://fs/main/resources/lib/angular-1.2.16/angular.min.js:6:450
at http://fs/main/resources/lib/angular-1.2.16/angular.min.js:33:332
at Array.forEach (native)
at q (http://fs/main/resources/lib/angular-1.2.16/angular.min.js:7:280)
at e (http://fs/main/resources/lib/angular-1.2.16/angular.min.js:32:445)
at http://fs/main/resources/lib/angular-1.2.16/angular.min.js:33:18
at Array.forEach (native)
at q (http://fs/main/resources/lib/angular-1.2.16/angular.min.js:7:280)
at e (http://fs/main/resources/lib/angular-1.2.16/angular.min.js:32:445
If you want to try to reproduce this, commit your changes. Delete a couple files here and there. Run your angular app. IF you delete enough you will soon get blank injector errors.
A few tips and tricks:
A similar injector error answer applies here: set a break point on the angular error code and look at the call stack.
Also, occasionally click the link at the top of the stack trace takes to a page (without the class name), but where the page's error has another stack trace link. Click on that link and the second page may have the name of the missing object.
Also, if you haven't moved to annotated code (which can make it easier to spot injector errors)In angular 1.3 and greater, you can use the directive 'ng=strict-di' on whatever element has the ng-app directive, and that will cause the app to throw an error on any un-annotated module--and it will include the function along with the parameters ('function($scope, service, something)') which is hopefully unique enough to find quickly.
I have a composite C1 site - working fine. Some pages use the MVC Player - which works fine - along with all pages on the site - except the Blog which causes a routing conflict.
Error: The incoming request does not match any route.
C1 Function: Composite.AspNet.MvcPlayer.Render
Error details:
Exception has been thrown by the target of an invocation.
The incoming request does not match any route.
This error appears at the top of the page - the blog works fine under the error - I just need to get rid of the cause of this error. I guess the MVC controller is trying to route the blog pages because it thinks they don't exist & can't find the controller.
How can I get the controller to ignore the blog - or fix this some other way?
Short answer is that both items (blog and mvc player) are fighting over the path portion of your URL. They both expect they own the path into bit to do routing.
Example: /en/Blog /2011/11/29/Chamonix-To-Courmayeur-Skiing-Day-Trips
The /en/Blog portion is routing you to the page hosting your blog, while the rest is path info that is passed along to any functions you may have hosted on the page. Since the path is "one thing" there is no distinction whether this string is intended for the blog function or the MVC Player function. This is what is creating the confusion.
Provided you wish to leave the blog as is you can work around this issue in two ways:
Move the feature you have in MVC Player to another function provider, like Razor Functions
Change the MVC Player so it does not pass the path info along to you MVC controller.
The second workaround can be done quick and dirty by editing ~/App_Code/Composite/AspNet/MvcPlayer/Player.cs and commenting out this line (line 57)
Path = PathInfo;
Before you do this note that this would impact all your running instances of MvcPlayer.
To create a new alternative MvcPlayer which does not rely on routing (leaving the original one intact) do this:
Copy Player.cs to NoRoutePlayer.cs (and rename the class accordingly) and make the above mentioned change there (comment out line 57).
Then register this new function in Composite C1 by going to Functions | C# Functions | Composite | AspNet | MvcPlayer and add a node here, using the existing Render element as inspiration. Just set the 'Type' name to NoRoutePlayer.
With that change you will have a Player function and a NonRoutingPlayer function and you can then use the latter to run your MVC controller, and everyone should get along just fine :)
I'm getting an error with an SDK2.0 app using a rally custom grid:
It only errors with IE (current), and it does not error if I run it locally, only when I install it in Rally and run it.
I don't know if its a Rally issue, or a EXTJS issue.
SCRIPT5007: Unable to get value of the property 'modelField': object is null or undefined
sdk.js, line 4 character 1276692
The code that failed:
if(e.modelField&&e.modelField.hidden)
Context around that error:
{xtype:"rallytextfield",allowBlank:false,removeNameAttribute:true}}},PortfolioItem:function(){return{hidden:true}},AttributeType:function(b){return a.apply(Rally.ui.grid.FieldColumnFactory.defaultRenderer(b),{sortable:false})}})})();(function(){var a=window.Ext4||window.Ext;var b=function(g,e){var d=g.text;var c=e.text;if(d>c){return 1}if(d<c){return -1}return 0};a.define("Rally.ui.grid.ColumnBuilder",{requires:["Ext.Array","Ext.util.Format","Rally.ui.grid.FieldColumnFactory"],constructor:function(){this.defaultColumns=[];this.autoAddAllModelFieldsAsColumns=true},withDefaultColumns:function(c){if(a.isArray(c)){this.defaultColumns=this.defaultColumns.concat(c)}return this},withSortableColumns:function(c){this.sortable=c;return this},shouldAutoAddAllModelFieldsAsColumns:function(c){this.autoAddAllModelFieldsAsColumns=c;return this},build:function(d){var e=a.Array.map(this.defaultColumns,function(g){if(a.isString(g)){return Rally.ui.grid.FieldColumnFactory.getColumnConfigFromField(d.getField(g),this.sortable)}return g},this);if(this.autoAddAllModelFieldsAsColumns){var c=this._buildModelColumns(d,this.defaultColumns,e);e=e.concat(c)}this._removeHiddenColumns(e);return this._stripTagsFromColumnText(e)},_removeHiddenColumns:function(d){for(var c=d.length-1;c>0;c--){var e=d[c];if(e.modelField&&e.modelField.hidden){a.Array.erase(d,c,1)}}}
Not sure what other guidance I can provide to help locate this issue.
The code was a bit large, so I started to do some divide and conquer before I posted it and I found the cause in my code, though probably not the root cause:
In my columnCfgs when adding the rallygrid, I had a trailing ',' on the last entry.
The really annoying thing is this works in all browsers locally, but only fails in IE on Rally with a super obscure error, so its really hard to chase down...even my JavaScript syntax highlighter did not warn me...
I suspect this is actually a problem in either Rally or EXT-JS code where IE is just really finicky...