Closed Nomeasmo closed 5 years ago
Thanks for raising this issue, @Nomeasmo. We should be able to work around this issue. :)
https://github.com/sanctuary-js/sanctuary-def/blob/v0.18.1/index.js#L214-L222:
var inspect = (function() {
/* istanbul ignore else */
if (typeof module === 'object' && typeof module.exports === 'object') {
var util = require ('util');
/* istanbul ignore else */
if (typeof util.inspect.custom === 'symbol') return util.inspect.custom;
}
return 'inspect';
} ());
We could do something like this instead:
var inspect = (function() {
var util;
try {
util = require ('util');
} catch (err) {
return 'inspect';
}
return util.inspect.custom === 'symbol' ? util.inspect.custom : 'inspect';
} ());
Are you able to test this change? I can't easily test it myself as I've never used React Native.
Thanks for your efforts, David. I tried the fix but it doesn't help, but brought me rethinking. No change is needed I just installed node-util
which solved it.
I tried to work with react native. React native is kind of node but limited in some way.
The
require('util')
in that file decides to import utils ifmodule.exports
is present.Could you imagine to have an option to opt out this require or an idea for work around that problem?