You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
varsomething=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.
Activity
minibikini commentedon Mar 25, 2016
Thanks for this, @thenikso!
Could you please name a npm module which does
require(__dirname + '/something.js')?thenikso commentedon Mar 25, 2016
I have this:
node_modules/pgpass/lib/index.jsnode_modules/pg-types/lib/textParsers.js(got them by npm installing
pg-promise, same thing withpg-bricks)gamaro7 commentedon Mar 31, 2016
I had this problem with
ajvmodule only on deploy. So I am back withserverless-optimizer-pluginthat runs smoothly.