Browser treating private class method like a private field, and is saying it is not enclosed inside a class
23:10 30 May 2026

I'm get the error: "private field #getInputBufferAdapter must be declared inside an enclosing class."

There are 2 problems with the error message.

  1. #getInputBufferAdapter() is a class method, and

  2. It IS declared inside of an enclosing class

Code seemed to behave well before, but some hours ago I decided to replace all my vars to let's and consts.

And now I'm getting the error I've described.

The code is based off of this link: https://github.com/cutterbl/SoundTouchJS/blob/master/packages/core/src/Stretch.ts#L697

I rewrote much of this typescript project in JavaScript.

The highlighted line is where the error occurs.

#getInputBufferAdapter is defined on line 1006.

Any help is appreciated, thanks

javascript