web3.unity icon indicating copy to clipboard operation
web3.unity copied to clipboard

ImportNftTexture not working in WebGL

Open juans-chainsafe opened this issue 1 year ago • 0 comments

Describe the bug This sample is not working again only in WebGL, not sure if is related to the same error that we had last time, but I see 2 errors: a CORS error and a Metadata request failure

Steps Steps to reproduce the behavior:

  1. Use the scene [SampleLogin - Metamask or SampleLogin - Web3Auth]
  2. Login with [Web3Auth or Metamask]
  3. Click on ImportNftTexture sample in ERC-1155 section

Expected behavior

  • Image is imported and displayed on the screen

Console errors Access to fetch at 'https://ipfs.chainsafe.io/ipfs/QmfUHuFj3YL2JMZkyXNtGRV8e9aLJgQ6gcSrqbfjWFvbqQ' from origin 'http://localhost:49764' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. GET https://ipfs.chainsafe.io/ipfs/QmfUHuFj3YL2JMZkyXNtGRV8e9aLJgQ6gcSrqbfjWFvbqQ net::ERR_FAILED

webgl.framework.js:30 Web3Exception: Metadata request failure: Unknown Error
  at Scripts.EVM.Token.Erc1155UnityExtensions.ImportTexture (ChainSafe.Gaming.Evm.Contracts.BuiltIn.Erc1155Contract contract, System.String tokenId) [0x00000] in <00000000000000000000000000000000>:0 

Screenshots/Video Screenshot 2024-07-05 at 10 42 45 AM

Desktop (please complete the following information):

  • Chainsafe SDK version: [main branch]
  • Unity Version: [2022.1]
  • Platform: [WebGL]
  • Operating System: [Mac]

Additional context Happens with Metamask login or Web3Auth

juans-chainsafe avatar Jul 05 '24 13:07 juans-chainsafe