Programming Web "/>

TypeError: is not a function

31 October 2023 at 10:58 pm

Article image for TypeError: is not a function

​Just a quick post to let others solve this. If you have a JS file using promises and get errors that say that “ is not a function” (or any other variant of that for other calls based on the filehandle) it might be for the same reason that I found.

The solution is really simple. I just forgot to “await” when I created the file handle, so it basically wasn’t ready when I accessed it.

let filehandle =, "r");

Changed it to:

let filehandle = await, "r");

So hard to see such a small omission, right?