Skip to content

Commit b78c8c5

Browse files
authored
fix: exit on unhandled promsie rejection (#566)
1 parent 8e266aa commit b78c8c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ You can do this by running: "npm install -g netlify-cli@latest" or "yarn global
6767
)
6868
}
6969
await restoreCache({ cache: utils.cache, distDir: nextConfig.distDir, nextRoot })
70+
71+
// Exit the build process on unhandled promise rejection. This is the default in Node 15+, but earlier versions just warn.
72+
// This causes problems as it doesn't then know the build has failed until we try to copy the assets.
73+
process.env.NODE_OPTIONS = [process.env.NODE_OPTIONS, '--unhandled-rejections=strict'].filter(Boolean).join(' ')
7074
},
7175
async onBuild({
7276
netlifyConfig,

0 commit comments

Comments
 (0)