how do I go about debugging this error :- ```Unhan...
# help
a
how do I go about debugging this error :-
Copy code
Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"ReferenceError: require is not defined","reason":"ReferenceError: require is not defined","promise":{},"stack":["Runtime.UnhandledPromiseRejection: ReferenceError: require is not defined","    at process.<anonymous> (file:///Users/ashish/work/planet-marathi/api-v2/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)","    at process.emit (node:events:527:28)","    at emit (node:internal/process/promises:140:20)","    at processPromiseRejections (node:internal/process/promises:274:27)","    at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
t
1.0 beta will give you a better error for this
Are you using esm? Seems like maybe you're using a non esm package
a
no, not using esm. I will consider switching to 1.0 as the last resort as I’m working on something critical and unfortunately can’t go about validating the migration manually right now.
b
I'd just throw in a few breakpoints, set the debugger to capture any thrown exceptions and go from there with
sst start
. Only just clocked a couple of months ago that you can debug the actual stack code - felt like a complete dumbass.
a
@Brinsley that sounds like a good idea, I’ll give that a try, thank you. 🙏
Here’s the exception from the stack, unfortunately it makes no sense to me -
Copy code
Exception has occurred: Error: ENOENT: no such file or directory, stat '/var/folders/ry/srxm3k_x4rdc0jz2fkhyc6tr0000gn/T/fnm_multishell_8535_1616444440508/bin/git'
  at Object.statSync (node:fs:1551:3)
    at Object.statSync (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:312:16)
    at Function.sync (/usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:13:23)
    at Function.sync (/usr/local/lib/node_modules/npm/node_modules/isexe/index.js:49:17)
    at Function.whichSync [as sync] (/usr/local/lib/node_modules/npm/node_modules/which/which.js:104:26)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/git/lib/which.js:5:19)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)