bigchaindb / js-utility-belt

Opinionated collection of JavaScript nice-to-haves
Apache License 2.0
5 stars 4 forks source link

No support for require in node #152

Open diminator opened 7 years ago

diminator commented 7 years ago
> require('js-utility-belt/lib')
ReferenceError: document is not defined
    at Object.<anonymous> (/home/dimi/code_ascribe/kyber/drivers/javascript/node_modules/js-utility-b
elt/lib/feature_detection/drag_and_drop_available.js:16:43)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/dimi/code_ascribe/kyber/drivers/javascript/node_modules/js-utility-b
elt/lib/feature_detection/index.js:8:32)
    at Module._compile (module.js:541:32)
sohkai commented 7 years ago

@diminator In case you're still having trouble with this, this is directly related to https://github.com/bigchaindb/js-utility-belt/issues/14. The issue is that we're not omitting certain parts of this library that don't make sense for a node build (e.g. the drag and drop module).

diminator commented 7 years ago

Thanks @sohkai, currently we plucked only the necessary files and made them part of the js-driver