Skip to content

Instantly share code, notes, and snippets.

@KeKs0r
Created June 17, 2019 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KeKs0r/236e24755fc567633788c934d7636659 to your computer and use it in GitHub Desktop.
Save KeKs0r/236e24755fc567633788c934d7636659 to your computer and use it in GitHub Desktop.
Zeit Would swallow issue
// This actually shows the error in the zeit logs and results in this response
/*
An error occurred with this application.
NO_STATUS_CODE_FROM_LAMBDA
*/
async function start() {
console.log("Before Server");
const server = require("./server");
console.log("Before Start");
console.time("serverStart");
const { url } = await server.listen();
console.timeEnd("serverStart");
console.log(`🚀 Server ready at ${url}`);
}
start();
// THIS WOULD RESULT IN THIS RESPONSE
/*
A server error has occurred
INTERNAL_SERVER_ERROR
*/
try {
console.log("Before Server"); // Not even this would be in the logs
const server = require("./server");
console.log("Before Start");
console.time("serverStart");
server.listen().then(({ url }) => {
console.timeEnd("serverStart");
console.log(`🚀 Server ready at ${url}`);
});
} catch (e) {
console.error(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment