Refreshing page on backbone application causes error - backbone.js

I have a backbone application that displays a list of content. The application works fine when navigating through it using the links etc, but I have noticed that when I refresh the browser in chrome i start to see an error saying 'Uncaught TypeError: Cannot read property 'href' of null' This error is occurring on line 969 of backbone.js.
The code that is causing this error is being executed in a loop via a the following code :
this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
Does anyone have any idea what is causing this? I am starting the backbone history using the following code :
Backbone.history.start();
My application is built with backbone, require.js and jquery mobile, however if I remove the jquery mobile dependancy I still see the same error so don't think it has anything to do with jquery mobile.
Any help would be greatly appreciated
Kind Regards
Brian

Related

React App not loading, showing "Uncaught SyntaxError: Unexpected token '<'" in console, but works in Private Window

I have browsed many possible solutions to this error with no success. I understand the fundamental issue is that the request to /static/js/main.[hash].js is expecting JS, and instead is returning HTML. I can not, however, understand why the application runs fine while using a Private window, and also will work ONE time after clearing cache and hard reload. In addition to the error message, we get a white screen and the app does not load.
Looking at the Network tab in the browser, I compared the request when working and when not working. I noticed that when working, i.e. in private window, it seems as though the HTML is fetched using a different endpoint, /null. The response is the same HTML that causes the error (the app HTML), but for some reason it works here.
It seems as though the error could be fixed if I could define the request to accept HTML or JSX, but I don't know where to find where this request is called as it seems as though this is all handled by Webpack.
One thing to note, is that when running yarn build and serving the build locally, we still get the error message, but the app does load (no white screen). In the local build HTML, we find a script tag like this:
<script src="undefined"></script>
While the production (breaking) build gives us this:
<script type="text/javascript" src="/static/js/main.ff34f559.js"></script>
edit: The project was created using CRA then freshly ejected
Any help is greatly appreciated!

Uncaught TypeError: angular.module(...).info Ionic1

I've got some issue for 2 days, it's getting on my nerve, if someone now how to fix this it will be very helpfull :
I've got a ionic 1 project, that I have to do some update, but nothing seems to work...
when i do ionic serve, and i look the console of the navigatori got :
Uncaught TypeError: angular.module(...).info is not a function
and
ReferenceError: Connection is not defined
at Object.isOnline
i'm stuck on the entry page and ng-src ng-click seems to not working.
I've look many post but nothing seems to resolve my problem.
Not all your angular scripts are the same version. .info was introduced recently, you might have angular files with different version.
Refer to related angular issue.
https://github.com/angular/angular.js/issues/15786
I got something like this :
Uncaught TypeError: angular.module(...).info is not a function
at angular-resource.js:445
at angular-resource.js:858
angular-resource.js:445:
angular.module('ngResource', ['ng']).
info({ angularVersion: '1.6.4' }).
provider('$resource', function ResourceProvider() {
var PROTOCOL_AND_IPV6_REGEX = /^https?:\/\/\[[^\]]*][^/]*/;
at angular-resource.js:858:
})(window, window.angular);
It appears that I can't ionic serve, that app, but I can cordova build android, on the computer that has develops it , but not on my computer which I develops ionic 2 project.
I don't know if this is from my npm, node, cordova version or if is something completly diferent.

Templates are not loading in IE11

My ui-router and custom directive templates are not loading in Internet Explorer 11. This is the error for each one:
[$compile:tpload] Failed to load template: blah/blah.html (HTTP status: undefined undefined)
Everything is working fine in Chrome, Firefox and Edge.
Any pointers or guesses of why this maybe happening would be greatly appreciated.
For JavaScript, In Internet Explorer, there is normally an issue because of 'use-strict' mode. If your application appears to somewhere have an object with two properties of the same name, 'use-strict' will cause it to crash.
For HTML, there must be a missing closing or an opening tag which is not rendering the pages
OK, this is fixed. There was an ES6 endsWith() method being used which is unsupported in IE11. There was no error regarding this in the console - I found the issue by ensuring "Break on all exceptions" was select in the IE dev tools debugger. The fix was to simply add a polyfill https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith

Copied working app, but "Uncaught ReferenceError: angular is not defined(…)"

I am afraid that I can't post code, as there is too much of, but am hoping that someone will recognize my problem.
I have an existing, working app, which I want to use as the basis for a new one.
So, I copied all of localhost/<some directory>/App1 to localhost/<some directory>/App2, but when I try to load the app, I get Uncaught ReferenceError: angular is not defined(…)
I just don't understand it. I have copied the entire directory and changed nothing. The first app still works fine, but the copy gives that error.
Any idea what I am doing wrongly?

Sencha Command + Error evaluating http://localhost/Production/app.js with message: TypeError: Cannot call method 'substring' of undefined

Im here trying to find out how to solve this little problem.
I've been working with Sencha Touch v2.1 to create all my views and stuff.
After that, i started working with Sencha Command v3.0.0.250 to improved performance in my app, but after Sencha C. do its own business and try to open the index.html (throw IIS) something like that occurrs. (using chrome)
"Error evaluating http:// localhost/Production/app.js with message: TypeError: Cannot call method 'substring' of undefined "
Whats going on? What substring is talking about?
Thanks in advance!
Ensure that you see no warning messages in the Console since you have to add requires following by the classes you will be using before building it.

Resources