Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3ced3d

Browse files
committed
fix(nuxt): ignore console.logs called outside event context
resolves #26308
1 parent 551ffaa commit b3ced3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export default (nitroApp: NitroApp) => {
2525
}
2626

2727
onConsoleLog((_log) => {
28-
const ctx = asyncContext.use()
28+
const ctx = asyncContext.tryUse()
29+
if (!ctx) { return }
30+
2931
const stack = getStack()
3032
if (stack.includes('runtime/vite-node.mjs')) { return }
3133

0 commit comments

Comments
 (0)