Im getting the following error when I import the lodash library…
Error
` ```uno
ERROR: Name: TypeError
ErrorMessage: undefined cannot be converted to an object
FileName: /<project_path>/bower_components/lodash/lodash.js
LineNumber: 718
JS StackTrace: TypeError: undefined cannot be converted to an object at runInContext (/<project_path>/bower_components/lodash/lodash.js:718) at anonymous (/<project_path>/bower_components/lodash/lodash.js:12321) at anonymous (/<project_path>/bower_components/lodash/lodash.js:10) at anonymous (MainView:10)
``` `
Currently it seems that only Parse and MomentJS have been tested to work, however, I think its essential that all standard JS libs which works in Node and Browsers must be functional, any thoughts much appreciated.
Hi!
We’ll investigate what is preventing this particular library from working.
Not all browser and node libraries will work. Some depend on browser/node (server) specific APIs which Fuse can not support completely, but we will work towards as high compatibility as possible.
However, it is possible to run browser-based libraries inside a WebView in Fuse.
On ln 718 in the lodash library, the following statement:
lodash.js, ln 718
` ```uno
var arrayProto = Array.prototype
``` `
If you share a little about what it takes to make a library compatible, and if we create a central index with a compatibility matrix, perhaps it would be possible to start adapting the libs we use ourselves ?
Perhaps it would be possible to use poly-fills or shims, e.g. like you likely have done with fetch which relies on “window” for that according to the specification.
another library that is part of my general stable of libs is async (https://github.com/caolan/async)… let me just quickly see if I can load that one without issues…
async seems not to be causing any problems.
It seems there has been an issue when running in preview or exporting to DotNetExe. I think I fixed the bug just now. At least I got lodash running fine here.