KaKi87
KaKi8717mo ago

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

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
3 Replies
Kevin Whinnery
Kevin Whinnery17mo ago
Sounds like an error transpiling your dependency - is this a packge on npm that we could make a test case for?
KaKi87
KaKi87OP17mo ago
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 ?
Kevin Whinnery
Kevin Whinnery17mo ago
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