Firefox - Cross-Origin Request Blocked

Hey Im using moralis on chrome without an issue. but on firefox I’m getting this error

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://registry.npmjs.org/-/v1/search?text=moralis&size=1. (Reason: CORS request did not succeed).

Could not verify SDK version

Hi @dilukangelo

Please share your HTML file with imports

<head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/static/img/ico.ico" type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="style_inventory.css" />
    <title>INVENTORY | Ghost Block</title>
    <link href="imgs/Favicon.png" style="" />
    <!--Important Libs-->
    <script
      src="//cdnjs.cloudflare.com/ajax/libs/axios/0.24.0/axios.min.js"
      integrity="sha512-u9akINsQsAkG9xjc1cnGF4zw5TFDwkxuc9vUp5dltDWYCSmyd0meygbvgXrlc/z7/o4a19Fb5V0OUE58J7dcyw=="
      crossorigin="anonymous"
      referrerpolicy="no-referrer"
    ></script>
    <script src="//cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
    <script src="//unpkg.com/moralis/dist/moralis.js"></script>
    <script
      src="//code.jquery.com/jquery-2.2.4.min.js"
      integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
      crossorigin="anonymous"
    ></script>
  </head>```
1 Like

Why don’t you put https before the links?
Also try to specify the exact version of Moralis https://unpkg.com/[email protected]/dist/moralis.js

It was previously like that, still got the same error. The imports works I think its trying to call https://registry.npmjs.org/-/v1/search?text=moralis&size=1 which causes the CORS issue. All works perfect on chrome

if you get that error, besides that error, everything works fine?

So I cant connect to the contract

const web3 = await Moralis.enableWeb3();
const webcontract = new web3.eth.Contract(contract.abi, contract.contract);

It throws this error

can you try to update Firefox in case that is not latest version?

Its on the latest version :confused:

One of the users on my app has the same issue on Firefox.

My app is using react-moralis. You can see the dependencies listed below:

"moralis": "0.0.176",
"react-moralis": "^0.3.11",

Here is a screenshot of the console errors that my user is encountering:

Let me know if there is any way to fix this.

are you sure you have that version of Moralis SDK?
what you get if you run: Moralis.CoreManager.get("VERSION")?