Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve module 'buffertools' #3

Open
yapro opened this issue Mar 24, 2016 · 2 comments
Open

Cannot resolve module 'buffertools' #3

yapro opened this issue Mar 24, 2016 · 2 comments

Comments

@yapro
Copy link

yapro commented Mar 24, 2016

$ 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
@matias-sandell
Copy link

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
}

@n1k0
Copy link

n1k0 commented Apr 6, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants