lelylan / simple-oauth2

A simple Node.js client library for Oauth2
http://lelylan.github.com/simple-oauth2/
1.6k stars 292 forks source link

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

Closed KrayzeeKev closed 3 months ago

KrayzeeKev commented 8 months ago

Context

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/hoek@11.0.4 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

jonathansamines commented 3 months ago

Released v5.0.1 with the @hapi/hoek update.