You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use fs.existsSync to avoid race condition (#56387)
Using `await fs.access` has couple of downsides. It creates unnecessary
async contexts where async scope can be removed. Also, it creates the
possibility of race conditions such as `Time-of-Check to Time-of-Use`.
It would be nice if someone can benchmark this. I'm rooting for a
performance improvement.
Some updates from Node.js land:
- There is an open pull request to add V8 Fast API to `existsSync`
method - nodejs/node#49893
- Non-existing `existsSync` executions became 30% faster -
nodejs/node#49593
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
'"next export" does not work with App Router. Please use "output: export" in next.config.js https://nextjs.org/docs/advanced-features/static-html-export'
246
245
)
@@ -284,7 +283,7 @@ export async function exportAppImpl(
284
283
285
284
constbuildIdFile=join(distDir,BUILD_ID_FILE)
286
285
287
-
if(!(awaitfileExists(buildIdFile))){
286
+
if(!existsSync(buildIdFile)){
288
287
thrownewExportError(
289
288
`Could not find a production build in the '${distDir}' directory. Try building your app with 'next build' before starting the static export. https://nextjs.org/docs/messages/next-export-no-build-id`
290
289
)
@@ -407,7 +406,7 @@ export async function exportAppImpl(
0 commit comments