That error message usually indicates that your trigger function didn’t return an acceptable response - possibly because an error was thrown. You can try wrapping your function with a try/catch, and returning the error details. Something like…
try {
// do the things
} catch (err) {
return buildOutput(String(err), 500, 'Internal Server Error');
}
I tried wrapping my function with a try catch, but the code is never reaching the catch and still returning the 424 error. Any hints on how to proceed?
Is it possible that’s something related to rate limit or size of the body object? I get a correct response when I return a smaller object, or could it be there’s something messed up in the data it’s not able to stringify it?
I tried with no return, and in both cases the same error and the console.log is not hit.
What is buildOutput? Seems like it should work without a return though.
For folks finding this thread based on the error message, please know the solution indicates one of many causes. Because web triggers lack runtime observability, you may not be able to determine what is the cause in your case. For that problem, I opened FRGE-1297.
In addition to failing to return a proper error code, I found a couple other problems.
FRGE-1298 If your package.json uses ”type”: “module” (fix on the way). More generally, try starting a new Forge app and creating a “reduced test case” by removing settings until you have a working web trigger, then add in settings 1 by 1 until you isolate the problem.
FRGE-1299 There is an additional bundling step (Forge Bundler) in the Forge Deploy step. Since you can’t control it directly, it can still cause dependencies to fail a deploy, even for the native Node.js runtime. As with above, use the “reduced test case” approach to strip out dependencies until you have a working web trigger, then add libs back in until you find what is “choking the bundler”.
With multiple potential causes, I recommend future cases should start as new threads so we can work through diagnosis more carefully on a case-by-case basis. The same error does not mean the same underlying problem. Hence, I’m also locking this thread to avoid more problem conflation.