metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!
https://metaplex.com
Apache License 2.0
3.32k stars 6.26k forks source link

[Bug]: Metaplex storefront: Network request failed #2108

Closed ernitingarg closed 2 years ago

ernitingarg commented 2 years ago

Which package is this bug report for?

storefront

Issue description

  1. git clone https://github.com/metaplex-foundation/metaplex.git
  2. cd metaplex/js
  3. yarn install && yarn bootstrap
  4. yarn start
  5. localhost:3000

Reference link: https://docs.metaplex.com/storefront/installation

image

image

Command

No response

Relevant log output

No response

Operating system

Windows-10

Priority this issue should have

High (immediate attention needed)

Check the Docs First

github-actions[bot] commented 2 years ago

This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.

k0d3d commented 2 years ago

For me, this happens when this request fails. check your console or network tab

fetch("https://api.metaplex.solana.com/", {
  "headers": {
    "accept": "*/*",
    "accept-language": "en-GB,en-US;q=0.9,en;q=0.8",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "pragma": "no-cache",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "cross-site",
    "sec-gpc": "1"
  },
  "referrer": "http://localhost:3000/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"method\":\"getProgramAccounts\",\"jsonrpc\":\"2.0\",\"params\":[\"p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98\",{\"encoding\":\"base64\"}],\"id\":\"706ab600-87ab-46e9-954c-6f4276369223\"}",
  "method": "POST",
  "mode": "cors",
  "credentials": "omit"
});
k0d3d commented 2 years ago

I figured out that the mainnet rpc url metaplex provides. Its a bit hardcoded in the code. One hack will be to replace all instances of "api.metaplex.solana.com" with your custom RPC url in the metaplex/js folder.