chore: fix nextjs warnings (#5010)

This commit is contained in:
Alex Yang
2025-09-30 18:16:45 -07:00
committed by GitHub
parent f932a28b66
commit a53664e5ed
2 changed files with 3 additions and 5 deletions

View File

@@ -148,7 +148,7 @@ async function isDocker() {
async function isWsl() {
try {
if (getVendor() === "cloudflare") return false;
if (typeof process === "undefined" || process.platform !== "linux") {
if (typeof process === "undefined" || process?.platform !== "linux") {
return false;
}
const fs = await importRuntime<typeof import("fs")>("fs");

View File

@@ -15,10 +15,8 @@ export type { AsyncLocalStorage };
let moduleName: string = "node:async_hooks";
const AsyncLocalStoragePromise: Promise<typeof AsyncLocalStorage> = import(
/**
* @webpackIgnore: true
* @vite-ignore
*/
/* @vite-ignore */
/* webpackIgnore: true */
moduleName
)
.then((mod) => mod.AsyncLocalStorage)