0

The code is working fine in my localhost. When I tried to build the app, I'm getting this error. enter image description here

It tells the issue is in wallets page. But I've rendered an simple code as this, it works fine in the localhost. Also for more information. There are some graphQL API's are hitting when I route to this page. Which not mine. It's already built as a SDK and I'm just using it.

"use client";

import React, { useState } from "react";
import { WalletsPage } from "@mojito-inc/secondary-market";
import Storage from "../utils/storage/storage";
import { images } from "../components/ui/Images";
import { ThemeProvider } from "@mui/material/styles";
import { connectWalletTheme } from "../providers/WalletDetailsTheme";
import ConnectWalletModal from "../components/modals/ConnectWalletModal";
import Container from "../components/container/Container";
import { toast } from "sonner";
import { useRouter } from "next/navigation";

const WalletDetailsPage = () => {
  const storage = new Storage();
  const router = useRouter();
  const walletDetails = storage.getWalletDetails();
  const [openModal, setOpenModal] = useState(false);

  const disConnectWallet = () => {
    storage.deleteItem("WalletDetails");
    router.refresh();
    toast.success("Your wallet has been successfully disconnected");
  };

  const config = {
    orgId: process.env.NEXT_PUBLIC_ORG_ID,
    paperClientId: process.env.NEXT_PUBLIC_PAPER_CLIENT_ID,
    chainId: 1,
    walletOptions: {
      enableMetamask: true,
      enableWalletConnect: true,
      enableEmail: true,
    },
  };

  const Image = {
    ethIcon: images.EthIcon.src,
    logo: images.SheseidoLogo.src,
    metamask: images.Metamask.src,
    walletConnect: images.ConnectWallet.src,
  };

  return (
    <>
      <ConnectWalletModal
        openModal={openModal}
        closeModal={() => setOpenModal(false)}
        screenType={"home-page"}
      />
      <Container>
        <ThemeProvider theme={connectWalletTheme}>
          <WalletsPage
            walletDetails={walletDetails}
            config={config}
            Image={Image}
            showWalletTab
            showActivityTab
            showAccountTab
            showViewItem
            showInvoice
            onClickLogout={disConnectWallet}
            onConnectWallet={() => setOpenModal(true)}
            onClickCard={() => undefined}
            onViewItem={() => undefined}
          />
        </ThemeProvider>
      </Container>
    </>
  );
};

export default WalletDetailsPage;

I don't knwo why I'm getting this error. Any help on this would be appreciated.

2
  • Since it is running fine locally, but not when deployed have you made sure that the environmental variables are set in Vercel and match what you have locally? Commented Nov 8, 2023 at 23:38
  • @WheninSeattle Yes, The env variables are set correctly. Commented Nov 9, 2023 at 10:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.