Closed frankfka closed 2 years ago
Thanks for the report. This appears to be related to the v6.x
change to the Magic JS build system. We introduced this change to support <script type="module" />
targets. The unintended side-effect is that our OAuthExtension
is still compiled to ES5 by default. So, this creates a problem where the ES5-formatted OAuthExtension
class extends from the ES6-formatted Extension
class inside of magic-sdk
.
We have plans to migrate our Magic JS extension code to this monorepo, where it will share a build system with the rest of Magic SDK (thus resolving the issue). We'll leave this issue open to track the status of that change.
For now, pointing at magic-sdk@5.x
should resolve the problem. There are no features at this time in magic-sdk@6.x
which are missing from 5.x
releases.
This issue has been resolved in magic-sdk@6.0.7
and @magic-sdk/oauth@0.9.2
, as well as for these other extensions:
@magic-ext/react-native-oauth
@magic-ext/webauthn
Our Web3-related extensions will follow suit.
Looking forward to the web3 fixes, it's an issue with @magic-ext/solana@1.0.0
.
@ideopunk 6.x
was all about better ES module compatibility, no API changes. You can use 5.x
in the meanwhile!
Closing this, as our remaining extensions have been ported to this monorepo!
✅ Prerequisites
magic-sdk
)?🐛 Description
When initializing the client with:
within Next.js, the following error is thrown
class constructors must be invoked with 'new'
.This only happens when calling
new OAuthExtension()
. The issue is gone when downgrading to"magic-sdk": "^5.1.0"
🌎 Environment
magic-sdk
@magic-ext/oauth
next
yarn