#(ts9005) Using `async_hooks` in JS throws confusing error

4 messages · Page 1 of 1 (latest)

real sand
#

howdy folks! i'm trying to use async_hooks in a ts project with js files, with allowJs true, checkJs false. it throws the following errors:

Declaration emit for this file requires using private name 'addEvent'. An explicit type annotation may unblock declaration emit. ts(9005)
Declaration emit for this file requires using private name 'addMetadata'. An explicit type annotation may unblock declaration emit. ts(9005)
azure mango
#

@real sand I think the rest of the content of the file is relevant? I don't think just adding that import is enough to trigger the error:

shut pythonBOT
#
Retsam19#2505

Preview:```ts
import {AsyncLocalStorage} from "async_hooks"

export default new AsyncLocalStorage()```

real sand
#

you know what, you're exactly right. when commenting that import, it just moves the error to the next line. thanks for the push!