When I've run billboard.js(bundled) on node.
I found three point that make script error. and It's working OK after fixed it locally.
window in bundled js.(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else {
var a = factory();
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
}
})(window, function() {// <--- window makes script error on node.
It looks like webpack has bug related with this issue.
isDefined is not working if parameter is not definedconst win = isDefined(window) && window.Math === Math ?
window : isDefined(self) && (
self.Math === Math ?
self : Function("return this")()
So I replace isDefined to typeof
var ua = window.navigator.userAgent;
It also could be solved by checking typeof window
After solved these 3 issues. I can see it runs successfully on node.
Hi @jongmoon, thanks for the suggestion.
For now, billboard.js is targeted to work on visible browser, which are required the objects you mentioned.
The support for SSR work environment sounds good to be implemented.
I'll take this for the future implementation. Thanks!
:tada: This issue has been resolved in version 1.9.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Most helpful comment
Hi @jongmoon, thanks for the suggestion.
For now, billboard.js is targeted to work on visible browser, which are required the objects you mentioned.
The support for SSR work environment sounds good to be implemented.
I'll take this for the future implementation. Thanks!