mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Gate async hooks warning behind an env var (#22280)
### What does this PR do? The async_hooks warning is mostly just noise. There's no action you can take. And React is now using this to track the error.stack of every single promise with a no-op if it's not in use, so let's be silent about this by default instead of noisy. ### How did you verify your code works? --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
2
bun.lock
2
bun.lock
@@ -40,8 +40,8 @@
|
||||
},
|
||||
},
|
||||
"overrides": {
|
||||
"bun-types": "workspace:packages/bun-types",
|
||||
"@types/bun": "workspace:packages/@types/bun",
|
||||
"bun-types": "workspace:packages/bun-types",
|
||||
},
|
||||
"packages": {
|
||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.21.5", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ=="],
|
||||
|
||||
@@ -324,7 +324,7 @@ class AsyncResource {
|
||||
function createWarning(message, isCreateHook?: boolean) {
|
||||
let warned = false;
|
||||
var wrapped = function (arg1?) {
|
||||
if (warned) return;
|
||||
if (warned || (!Bun.env.BUN_FEATURE_FLAG_VERBOSE_WARNINGS && (warned = true))) return;
|
||||
|
||||
const known_supported_modules = [
|
||||
// the following do not actually need async_hooks to work properly
|
||||
|
||||
Reference in New Issue
Block a user