simple-oauth2 icon indicating copy to clipboard operation
simple-oauth2 copied to clipboard

simple-oauth2 not usable in NodeJS v20 - @hapi/hoek dependency needs to be updated to v11

Open KrayzeeKev opened this issue 1 year ago • 0 comments

Context

  • node version: v20
  • module version with issue: v5
  • last module version without issue: N/A
  • environment (e.g. node, browser, native): Node
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

Old versions of @hapi/hoek clone their options argument. We pass in a proxy element which contains a URL object. As of Node v20, the URL object can not be deep copied just by copying members as this breaks private members. @hapi/hoek deep clones its options object. This is silly (and the NodeJS authors say it's a REALLY bad idea) but they are locked into that design pattern. @hapi/[email protected] introduces a special case to handle URL copying.

Unless @hapi/hoek dependency is updated, this module is unusable from NodeJS v20 onwards.

What was the result you got?

err: TypeError: Client request error: Cannot read private member #context from an object whose class did not declare it (This error is being thrown by the NodeJS url.js builtin because @hapi/hoek@10 is broken)

What result did you expect?

No error

KrayzeeKev avatar Jan 08 '24 08:01 KrayzeeKev