starknet-io / get-starknet

StarkNet wallet <-> dApp bridge
MIT License
160 stars 115 forks source link

get-starknet v4 UI is not working #257

Open PhilippeR26 opened 4 months ago

PhilippeR26 commented 4 months ago

With :

"get-starknet": "^4.0.0",

This code in a Next.js project :

import { connect } from "get-starknet";
const getWalletSWO = await connect({ modalMode: "alwaysAsk", modalTheme: "light" });

is not displaying the default UI to select a wallet, and is generating an error : image

@amanusk

naorye2 commented 4 months ago

@PhilippeR26 I created NextJS page with the following component :

import Head from "next/head";
import styles from "@/styles/Home.module.css";
import { connect } from "get-starknet";

export default function MyPage() {
  async function handleClick() {
    const getWalletSWO = await connect({
      modalMode: "alwaysAsk",
      modalTheme: "light",
    });
  }

  return (
    <>
      <Head>
        <title>Create Next App</title>
        <meta name="description" content="Generated by create next app" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="icon" href="/favicon.ico" />
      </Head>
      <main className={styles.main}>
        <button onClick={handleClick}>Click me</button>
      </main>
    </>
  );
}

And didn't get the issue. Can you send reproduction?

PhilippeR26 commented 4 months ago

I created a minimalist Next.js project that will show how to replicate the problem : https://github.com/PhilippeR26/bugGetStarknet4

naorye2 commented 2 months ago

@PhilippeR26 "get-starknet": "^4.0.0" is not a legit version and we should remove it. Can you try "@starknet-io/get-starknet": "^4.0.0" ? This work for me.