Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nftStorageUploader on Next.js App throws polyfill error #136

Open
berkaycirak opened this issue Jul 13, 2024 · 2 comments
Open

nftStorageUploader on Next.js App throws polyfill error #136

berkaycirak opened this issue Jul 13, 2024 · 2 comments

Comments

@berkaycirak
Copy link

Hi, I want to make a section on my dapp to mint an nft. To do that, I need to upload images to ipfs but that code throws me error on frontend. Does anyone have that issue before?

import { mplCore } from "@metaplex-foundation/mpl-core";
import { GenericFile } from "@metaplex-foundation/umi";
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
import { nftStorageUploader } from "@metaplex-foundation/umi-uploader-nft-storage";
import { clusterApiUrl } from "@solana/web3.js";
const MintNFTSection = () => {
  const umi = createUmi(clusterApiUrl("devnet")).use(mplCore());
  umi.use(
    nftStorageUploader({
      token: "60b43e86.cec3fd1101fe4cb38d32e4048c72eb41",
    }),
  );

  const mintNFT = async (imageFile: GenericFile) => {
    const [imageUri] = await umi.uploader.upload([imageFile]);
  };
  return <div>MintNFTSection</div>;
};

export default MintNFTSection;

ERROR

image

@bdeak4
Copy link

bdeak4 commented Aug 30, 2024

we have same issue here, did you manage to resolve this?

@berkaycirak
Copy link
Author

I have solved it without using nftStorageUploader :), I have uploaded it using default uploader of umi

import { createBundlrUploader } from '@metaplex-foundation/umi-uploader-bundlr';

const uploader = createBundlrUploader(umi);
const jsonURI = await uploader.uploadJson(metadata);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants