Javascript SDK - toMetaplexFileFromBrowser is not a function ERROR #255
-
Hi, I'm working on creating NFT using Metaplex javascript SDK. I need to upload image and video to Arweave (using Bundler storage). I want to use metaplex file type inside SDK. I tried all below functions. Getting same error for all functions
Same error, toMetaplexFileFromBrowser is not a functionimport { toMetaplexFileFromBrowser, toMetaplexFileFromJson, toMetaplexFile } from "@metaplex-foundation/js"; const file = toMetaplexFileFromJson({ foo: 42 }); const file = toMetaplexFile('The content of my file', 'my-file.txt'); const buffer = fs.readFileSync('/path/to/my-file.txt'); const browserFile: File = event.target.files[0]; Anyone can help? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi there 👋 Webpack is a bit of a tricky one with crypto-related packages and may require some extra settings. Did you check the |
Beta Was this translation helpful? Give feedback.
-
The problem was that you were not using the latest version of the SDK. Here's a fix: BushraHussain/metaplex-js-sdk#1 |
Beta Was this translation helpful? Give feedback.
The problem was that you were not using the latest version of the SDK.
Here's a fix: BushraHussain/metaplex-js-sdk#1