Open EvanCarroll opened 9 years ago
That's because the bower version of react-bootstrap isn't CommonJS compatible, it's made for using in a browser.
Per their bower.json, the main file is react-bootstrap.js, a pre-built AMD/browser global file that's not meant to be used inside node or browserify or anything else that uses CommonJS.
Note that even if you included react-bootstrap/index.js
directly, you'll still be headed down a path of sadness, since that is an AMD file, not a CommonJS file.
So either convince react-bootstrap to use UMD instead of AMD in their pre-built file, or use a non-bower version of react-bootstrap (possibly the npm version?), or try to figure out the exact right deamdify+debowerify+shim combination to trick the bower version into playing nice :)
Can we at least fail intelligibly? Is it possible in this situation?
It has nothing to do with debowerify, and everything to do with the fact that calling require()
on a non-CommonJS file just doesn't work. And it's not debowerify's place to catch that, even if it is possible. This issue is why deamdify exists, and you might have some luck using that :)
Simple test with react-bootstrap
https://github.com/EvanCarroll/debowerify-fail
react-bootstrap/index.js
has a series of requiresWhile the file,
./Acordion.js
has itself a series of requires.These don't seem to be resolvable with
react-bootstrap
.