fukaoi / solana-suite

To develop Solana applications easily, even for beginners
https://www.solana-suite.org
MIT License
29 stars 7 forks source link

Error: Index out of range #173

Closed n-truongnx closed 1 year ago

n-truongnx commented 1 year ago

i try to use function Metaplex.feePayerPartialSignMint but i hit that error: error: RangeError: Index out of range this is my code

Screen Shot 2023-04-21 at 16 05 52 Screen Shot 2023-04-21 at 16 04 54

what wrong with my code? pls help

fukaoi commented 1 year ago

What is your development environment?

Are you trying to run on React.js?

What version of Solana Suite are you running?

n-truongnx commented 1 year ago

yeah, i am trying on Reactjs. i work on macos this is my package.json

Screen Shot 2023-04-21 at 22 03 00
fukaoi commented 1 year ago

@n-truongnx Thanks response.

I have created a sample repository of react.js here. It works fine, so it does not seem to be a Solana Suite issue.

Exmple code react-solana-suite/src/App.js


import { Metaplex } from '@solana-suite/nft';

const demoOwner = 'Hh7nDDB8nNY2QcQLHG5SdVKXd6Q3ZpiT5CBxnxCxjkDp'; const demoSecret = '4GXGESeUqw75z9iUyvUrFoCFMMRaDaS3XXKsuVcQJEcd2wGFgUcqVivtNAJmZ7o3KbmzsRaBLTVs48rXXaA7mSeE'; const demoPayer = 'H7WEabRV8vvCJxK8forAUfeXunoYpWFbhewGj9eC4Pj8'; const demoPayerSecret = '4DRpsEkwfAMc7268urkNu2AFC4tweXTLJArwXG9LGvjqcFUoy9mqmBZHLhf2yHEbj3AgrjVppEBQ5hfBTnDzLVSA';

const demoInput = { name: 'name', symbol: 'VE', royalty: 5, uri: 'https://ipfs.io/ipfs/bafkreiczvsz3siw62qium44l27nm24lg5foftpogjyav23fdbvrltrewrm', };

(async () => { const inst = await Metaplex.feePayerPartialSignMint( demoOwner, demoSecret, demoInput, demoPayer ); console.log(inst);

const res = await inst.unwrap().submit(demoPayerSecret); console.log(res.unwrap().toExplorerUrl()); })();

function App() { return

; }

export default App;



It may be an issue with the React.js dependent libraries. You may want to compare it with this [package.json.](https://github.com/fukaoi/react-solana-suite/blob/main/package-lock.json)

React.js (webpack) and crypto library are not compatible. :sweat_smile: 

![Screenshot from 2023-04-22 09-32-11](https://user-images.githubusercontent.com/186659/233752759-371005cb-95a2-4ca2-81dc-a63c246b344f.png)
ken-z-dev commented 1 year ago

Ak sorry, it seem like uri too long, i just change uri to a shorter s3 url and it run ok. pls close this issuse, Many thanks

fukaoi commented 1 year ago

Oh, So good! closed