magiclabs / magic-js

Magic browser/React Native JavaScript SDK is your entry-point to integrating passwordless authentication inside your application.
https://magic.link/docs/api-reference/client-side-sdks/web
Apache License 2.0
457 stars 85 forks source link

Type 'SolanaExtension' is not assignable to type 'Extension<string>'. Types have separate declarations of a private property '__sdk_access_field_descriptors__'. #702

Open enahs opened 7 months ago

enahs commented 7 months ago

โœ… Prerequisites

๐Ÿ› Description

this is similar to #680 but obviously for solana. Tested with the version in the [demo](Solana JavaScript Web3 example) and it works (magic-sdk 19.0.0 and magic-ext/solana 15.0.0 ) so definitely something broken here.

Per the solana integration documentation, this should work, but i get the following error from typescript:

Type 'SolanaExtension' is not assignable to type 'Extension'. Types have separate declarations of a private property '__sdk_access_field_descriptors__'

๐Ÿงฉ Steps to Reproduce

see description

๐Ÿค” Expected behavior

I expect to be able to login and get the solana wallet without an error

๐Ÿ˜ฎ Actual behavior

error causes build to break.

๐Ÿ’ป Code Sample

import { SolanaExtension } from "@magic-ext/solana";
import { Magic } from "magic-sdk";

const getMagic = () => {
  const MAGIC_LINK_PUBLISHABLE_KEY = process.env.NEXT_PUBLIC_MAGIC_LINK_PUBLISHABLE_KEY;

  try {
    const magic = new Magic(MAGIC_LINK_PUBLISHABLE_KEY, {
      extensions: [
        new SolanaExtension({
          rpcUrl: "RPC_URL_HERE",
        }),
      ],
    });
    return magic;
  } catch (err) {
    console.error(err);
  }
};
export default getMagic;

๐ŸŒŽ Environment

Software Version(s)
magic-sdk 22.0.0
magic-ext/solana 19.0.0
Browser
yarn
Operating System
petermazzocco commented 2 weeks ago

Any resolution to this?