TypeError: 1 is Undefined, Highcharts - highcharts

See my code here:
http://jsfiddle.net/w6khzavx/22/
It works ok here but returns TypeError: 1 is Undefined in production.
It also works ok locally. Both production and local have the same Highcharts/Highstock versions[9].

Related

Nestjs TypeError: applicationConfig.getVersioning is not a function

I have reinstalled #nestjs/swagger and swagger-ui-express. All my dependencies are up to date. But I get this error:
applicationConfig.getVersioning is not a function at SwaggerExplorer.exploreRoutePathAndMethod
I have updated metadata tags in tsconfig.ts file as well. After debugging, I can find that the main issue is at line where createDocument function is called from Swagger Module class. Every code line before that works fine.
On console logging, I even could extract the values of config-correctly. However, once the createDocument method is called, the API comes to a crashing halt with the above stated error.
/home/prasanna/my_project/TapisProject/API/API/node_modules/#nestjs/swagger/dist/swagger-explorer.js:125
const controllerVersion = this.getVersionMetadata(metatype, applicationConfig.getVersioning());
^
TypeError: applicationConfig.getVersioning is not a function
at SwaggerExplorer.exploreRoutePathAndMethod (/home/prasanna/my_project/TapisProject/API/API/node_modules/#nestjs/swagger/dist/swagger-explorer.js:125:87)
at /home/prasanna/my_project/TapisProject/API/API/node_modules/#nestjs/swagger/dist/swagger-explorer.js:72:45
at Array.reduce ()
at /home/prasanna/my_project/TapisProject/API/API/node_modules/#nestjs/swagger/dist/swagger-explorer.js:71:99
at /home/prasanna/my_project/TapisProject/API/API/node_modules/lodash/lodash.js:13469:38
at /home/prasanna/my_project/TapisProject/API/API/node_modules/lodash/lodash.js:4967:15
at baseForOwn (/home/prasanna/my_project/TapisProject/API/API/node_modules/lodash/lodash.js:3032:24)
at Function.mapValues (/home/prasanna/my_project/TapisProject/API/API/node_modules/lodash/lodash.js:13468:7)
at MapIterator.iteratee (/home/prasanna/my_project/TapisProject/API/API/node_modules/#nestjs/swagger/dist/swagger-explorer.js:71:45)
at MapIterator.next (/home/prasanna/my_project/TapisProject/API/API/node_modules/iterare/src/map.ts:9:39)
need to upgrade #nestjs/core as well –

Summernote on Rails Production broken

I'm having some trouble with getting Summernote to work correctly on my production Rails environment (on Heroku). I'm using rails 4.2.0, bootstrap 4.1.3, and summernote-rails 0.8.10.0.
Everything works fine locally but is broken on production.
There are no errors when the editor loads but as soon as you click in to any of the text fields there are the following errors:
First-
Uncaught TypeError: Cannot read property 'hide' of undefined
at e.hide (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at e.update (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at e.invoke (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:142)
at e.update (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:140)
at HTMLTextAreaElement.summernote.mousedown (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:140)
at HTMLTextAreaElement.dispatch (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at HTMLTextAreaElement.m.handle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:32)
at Object.trigger (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at HTMLTextAreaElement.<anonymous> (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at Function.each (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:22)
Second-
Uncaught TypeError: t.slice is not a function
at i (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:139)
at e.current (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:139)
at e.currentStyle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:140)
at e.invoke (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:142)
at e.updateCurrentStyle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at e.invoke (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:142)
at HTMLTextAreaElement.<anonymous> (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at HTMLTextAreaElement.dispatch (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at HTMLTextAreaElement.m.handle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:32)
at Object.trigger (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
Both these js errors seem to be coming from Bootstrap.
Also, I guess it does "work" on production but it the extra input fields and just looks broken. Like so-
Anyone got any ideas? Thanks!
I upgraded to Rails 5 and that fixed the minification problem.

Seems nil CAN be coerced to a float?

In my application I'm seeing the following exception:
TypeError: nil can't be coerced into Float
I'm iterating through a hash and running the following:
v[:score] = (1 / v[:distance].to_f) * v[:weight]
However, when I try to debug at the rails console, I don't get an exception. In fact, if I run:
nil.to_f
I get 0. So at the console running my line above yields Infinity since I'm dividing by zero.
So my question is, it seems that nil CAN be coerced to a float, so why am I getting an exception in my application?
Thanks!
The error can occur :
arup#linux-wzza:~> pry
[1] pry(main)> (1/2.0) * nil
TypeError: nil can't be coerced into Float
from (pry):1:in `*'
[2] pry(main)>
In your app I am sure v[:weight] is giving nil. Problem is not from v[:distance], as you have handled it v[:distance].to_f. Check twice, I am damn sure, v[:weight] is nil in any situation.

Using angular.dart with Bootstrap yields Object #<Document> has no method 'getAttribute'

When using Angular.dart 0.9.10 with bootstrap 3.1.1, and compiling to Javascript, I get an ugly stacktrace attached below.
The stacktrace is printed in the console any time I for instance focus a textfield or enter some text.
This has worked previously, so I wonder if it is a bug with the shadow_dom implementation?
The app is currently quite simple and works correctly with Dartium. The same issue occurs after javascript compilation in both Firefox and Chrome.
It works when I remove below line from index.html
<script src="packages/shadow_dom/shadow_dom.debug.js"></script>
The stacktrace in pure text:
TypeError {stack: "TypeError: Object # has no method 'getAt…/packages/shadow_dom/shadow_dom.debug.js:2805:28)", message: "Object # has no method 'getAttribute'"}
message: "Object # has no method 'getAttribute'"
stack: "TypeError: Object # has no method 'getAttribute'↵ at Function.Sizzle.attr (http://localhost:8000/bower_components/jquery/dist/jquery.js:1422:9)↵ at Array. (http://localhost:8000/bower_components/jquery/dist/jquery.js:1618:25)↵ at http://localhost:8000/bower_components/jquery/dist/jquery.js:2116:22↵ at superMatcher (http://localhost:8000/bower_components/jquery/dist/jquery.js:2322:12)↵ at select (http://localhost:8000/bower_components/jquery/dist/jquery.js:2483:28)↵ at Function.Sizzle (http://localhost:8000/bower_components/jquery/dist/jquery.js:838:9)↵ at HTMLDocument.jQuery.event.handlers (http://localhost:8000/bower_components/jquery/dist/jquery.js:4416:48)↵ at HTMLDocument.jQuery.event.dispatch (http://localhost:8000/bower_components/jquery/dist/jquery.js:4353:40)↵ at Document.elemData.handle (http://localhost:8000/bower_components/jquery/dist/jquery.js:4057:28)↵ at invoke (http://localhost:8000/packages/shadow_dom/shadow_dom.debug.js:2805:28)"
__proto__: Error
constructor: function TypeError() { [native code] }
name: "TypeError"
stack: undefined
__proto__: d
"TypeError: Object # has no method 'getAttribute'
at Function.Sizzle.attr (http://localhost:8000/bower_components/jquery/dist/jquery.js:1422:9)
at Array. (http://localhost:8000/bower_components/jquery/dist/jquery.js:1618:25)
at http://localhost:8000/bower_components/jquery/dist/jquery.js:2116:22
at superMatcher (http://localhost:8000/bower_components/jquery/dist/jquery.js:2322:12)
at select (http://localhost:8000/bower_components/jquery/dist/jquery.js:2483:28)
at Function.Sizzle (http://localhost:8000/bower_components/jquery/dist/jquery.js:838:9)
at HTMLDocument.jQuery.event.handlers (http://localhost:8000/bower_components/jquery/dist/jquery.js:4416:48)
at HTMLDocument.jQuery.event.dispatch (http://localhost:8000/bower_components/jquery/dist/jquery.js:4353:40)
at Document.elemData.handle (http://localhost:8000/bower_components/jquery/dist/jquery.js:4057:28)
at invoke (http://localhost:8000/packages/shadow_dom/shadow_dom.debug.js:2805:28)"
I am not sure on the exact details why, but angular dart has a boostrap implementation:
https://github.com/akserg/angular.dart.ui
Likely, that one will work better for you.
Best Regards,
Paul

Console error with example of ui.bootstrap.datepicker

I try to use angular-ui-bootstrap datepicker and it upset me for a while with an error on firebug console (Firefox 21) saying
Error: array is undefined
indexOf#http://localhost:9000/components/angular/angular.js:526
arrayRemove#http://localhost:9000/components/angular/angular.js:535
JQLiteUnbind#http://localhost:9000/components/angular/angular.js:1630
JQLite.prototype[name]#http://localhost:9000/components/angular/angular.js:2203
.link/<#http://localhost:9000/components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js:1
Scope.prototype.$digest#http://localhost:9000/components/angular/angular.js:7942
Scope.prototype.$apply#http://localhost:9000/components/angular/angular.js:8143
done#http://localhost:9000/components/angular/angular.js:9170
completeRequest#http://localhost:9000/components/angular/angular.js:9333
createHttpBackend/</xhr.onreadystatechange#http://localhost:9000/components/angular/angular.js:9304
http://localhost:9000/components/angular/angular.js
Line 5754
After I check every datepicker settings I check the given example in documentation, followed the link "edit it on plunker" and I got a similar error.
Error: array is undefined
indexOf#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:510
arrayRemove#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:519
JQLiteUnbind#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1596
JQLite.prototype[name]#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2149
.link/<#http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.5.0.js:1229
Scope.prototype.$digest#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:7878
Scope.prototype.$apply#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:8079
bootstrap/<#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:962
invoke#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2843
bootstrap#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:961
angularInit#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:936
#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:14729
trigger#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1723
createEventHandler/eventHandler/<#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1958
forEach#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:133
createEventHandler/eventHandler#http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1957
http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js
Line 5687
Then I try Chrome Version 26.0.1410.63 and I got a different error
TypeError: Cannot read property 'indexOf' of undefined
at indexOf (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:510:12)
at arrayRemove (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:519:15)
at JQLiteUnbind (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:1596:7)
at Object.JQLite.(anonymous function) [as unbind] (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2149:17)
at Object.fn (http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.5.0.js:1229:21)
at Object.Scope.$digest (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:7878:27)
at Object.Scope.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:8079:24)
at http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:962:13
at Object.invoke (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:2843:25)
at bootstrap (http://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js:960:12)
It works but the error message upset me a lot and I thought that was something wrong with my code.
Can I assume this is not related with example given but with some internals or is the example missing something?
ui-bootstrap 0.5.0 has a bug,
(it tries to unbind 'focus' event handler, but handler doesn't exist)
https://github.com/angular-ui/bootstrap/blob/gh-pages/ui-bootstrap-tpls-0.5.0.js#L1226
you can apply this changes
https://github.com/angular-ui/bootstrap/commit/bf30898da27272df75f6c7ff26545ed16ebf1978
or build it directly from github
or wait for 0.6.0

Resources