node-deeper
node-deeper copied to clipboard
Cannot resolve module 'buffertools'
$ webpack
Hash: fa21190dc85f7f306103
Version: webpack 1.12.14
Time: 4517ms
Asset Size Chunks Chunk Names
personalDataComponent.js 890 kB 0 [emitted] personalDataComponent
+ 194 hidden modules
WARNING in /var/www/promo/~/react-jsonschema-form/~/deeper/index.js
Module not found: Error: Cannot resolve module 'buffertools' in /var/www/promo/node_modules/react-jsonschema-form/node_modules/deeper
@ /var/www/promo/~/react-jsonschema-form/~/deeper/index.js 14:21-43
Probably due to the fact that the module tries to require buffertools but fails?
try {
deeper.fastEqual = require('buffertools').equals
} catch (e) {
// whoops, nobody told buffertools it wasn't installed
}
Most definitely an issue for people using bundlers like browserify or webpack, aka ~95% of the frontend developers community :)
Shooting in the dark here, but I wonder if something like global["require"]("buffertools") or similar hack would prevent bundlers to parse the statement at compilation time? (yeah, that's ugly anyway)
Maybe a cleaner way would be to expose two different entry points, one expecting buffertools to be available and the other not, so you could import either deeper or deeper/no-buffertools.