D
Deno

help

How to solve "cannot be invoked without 'new'" thrown from an NPM module ?

Kkaki877/19/2023
Hello, An NPM module (which I don't own) uses call on something, which throws a cannot be invoked without 'new' error. How can I solve this ? Thanks
KWKevin Whinnery7/19/2023
Sounds like an error transpiling your dependency - is this a packge on npm that we could make a test case for?
Kkaki877/21/2023
Oh, so it's package-specific ? The package is light-my-request. Here's the suspected location of the error : https://github.com/fastify/light-my-request/blob/1877c89d339636b2766f9321f96016aba4fa376c/lib/response.js#L10 Thanks Hello ?
KWKevin Whinnery7/21/2023
I can confirm the issue, but I'm not entirely sure what's going on - I've created an issue on the Deno project to investigate further: https://github.com/denoland/deno/issues/19901

Looking for more? Join the community!