ember-scrollable
ember-scrollable copied to clipboard
Number.parseInt(offset, 10) not a function
I'm using your module through ember-light-table, and I'm getting this error when testing through phantomjs: "TypeError: undefined is not a function (evaluating 'Number.parseInt(offset, 10)')", at the function call here.
I'm not sure what would cause Number.parseInt() to be undefined.
Switching to the global isNaN and global parseInt from the Number one fixes my problem. I have a PR here. https://github.com/alphasights/ember-scrollable/pull/51
@Syzygy24 what version of phantomJS are you using?
we can do (Number.parseInt || parseInt)(offset, 10)
, but Number.parseInt
is part of ES6, should probably be handled by core.js through babel. see https://github.com/babel/ember-cli-babel#polyfill
https://github.com/alphasights/ember-scrollable/blob/master/package.json#L48
extra debugging
https://github.com/babel/ember-cli-babel/blob/v5.1.6/index.js#L41
https://github.com/babel/ember-cli-babel/blob/v5.1.6/package.json#L24
https://github.com/babel/broccoli-babel-transpiler/blob/v5.4.5/package.json#L31
https://github.com/zloirock/core-js/blob/v1.0.0/library/index.js
https://github.com/zloirock/core-js/blob/v1.0.0/library/shim.js#L19
I'm on phantom 2.1.1 I'll take a look at the babel stuff
I'm running into this now too, any ideas on a fix/workaround?
@offirgolan we can merge https://github.com/alphasights/ember-scrollable/pull/51 or downstream people can do the babel polyfill fix above for testing.
I'm not sure what the attitude is for Ember & addons w.r.t browser compatability.
I'm a noob, after some more digging I got the polyfill working fine. If anyone else is looking for a solution to this just put the following in your ember-cli-build.js
:
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
"ember-cli-babel": {
includePolyfill: true,
},
...
});
...
});
Obviously this could still be fixed via the PR but FWIW I'm totally fine with the polyfill solution.