Hello (again),
So some node_modules have requires like so:
var something = require(__dirname + '/something.js');
And, when deployed, will throw an error like: "Cannot find module '<my local computer dir name>/node_modules/.../something.js'"
I fixed this by modifying the actual node module(s) and replace those imports with:
var something = require('./something.js');
Is there a better way to handle this?
On a related note, for future reference, the pg package has a require('pg-native') that throws Cannot find module 'pg-native' from '[...]/node_modules/pg/lib/native' during deploy. That can be solved with the ignore configuration for babel.
Thanks!
Hello (again),
So some
node_moduleshave requires like so:And, when deployed, will throw an error like:
"Cannot find module '<my local computer dir name>/node_modules/.../something.js'"I fixed this by modifying the actual node module(s) and replace those imports with:
Is there a better way to handle this?
On a related note, for future reference, the
pgpackage has arequire('pg-native')that throwsCannot find module 'pg-native' from '[...]/node_modules/pg/lib/native'during deploy. That can be solved with theignoreconfiguration for babel.Thanks!