Today has been a bad day all round and as a last ditch attempt to make myself feel better I figured I’d try removing my node_modules directory with rm -rf node_modules
and then just build for a production release:
npm install --prod
This would give me a nice svelte set of functions that I could push up to AWS. Problem is? It went up but I started getting the following error:
Unable to import module 'lib/authorize': Error
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/var/task/lib/oauth.js:2:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/var/task/lib/authorize.js:3:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
Note: the
authenticate
function is my own function and it’s small and been working for a long time
Ok, so I figured I was trying to be too fancy (my 32mb function was now only 3mb). Admittedly 3mb is closer to what it should be but that’s an open issue. Anyway I went back to the full set of deps (dev and prod) and back to 32mb. Unfortunately the same error keeps on happening. What is going on?
Now one other thing … I noticed that I have updated to the Serverless Framework version 1.2.1
which actually was not intended (I had been on 1.1 prior) … it’s possible that this is part of the puzzle.