Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox: Error: NetworkError when attempting to fetch resource #32

Closed
sattinos opened this issue Jan 18, 2021 · 4 comments
Closed

Firefox: Error: NetworkError when attempting to fetch resource #32

sattinos opened this issue Jan 18, 2021 · 4 comments

Comments

@sattinos
Copy link

Steps to reproduce

Follow the example in the documentation:
https://in3.readthedocs.io/en/develop/api-wasm.html?highlight=html#in3-in-browser

Expected behavior

The latest block info, such as:

{
  "author": "0x005e288d713a5fb3d7c9cf1b43810a98688c7223",
  "difficulty": "0xec64a82f7ead3",
  "extraData": "0x707079652d786e706f6f6c2e636e2f5838",
  "gasLimit": "0xbea427",
  "gasUsed": "0xbe9f47",
  "hash": "0xd66f5ce664bf84db7c49ea6e3207958423b65aa1ea2f19947acf44c8b6180acd",
  "logsBloom": "0xd1306020662a0c08118bd524984e53a81084954e91911426726d694d868ac1b14e0f37633abc997296391ac8014633cb42201330b809c90101583696b278c080b038444ad99e4f6fd9d2408c82a8c8687010de159140340a8fec4720ce83a20f5640998616c0048021602a352418dc5447604a38949f9c981e1c0e301812212030a411d9810da40c22640c95040666a28d04842521a094489664b06e621e6aa4a34fd82932c2ea3b34b1f4c8099edc1180b106a98323ce2352250228b8a80b758a980082312804038554a020531a1f5fb4128a632f03d5720b73413670243004233f758d1a731c01840c82286783e4843f88100411f1b854215892e12eda1c6c",
  "miner": "0x005e288d713a5fb3d7c9cf1b43810a98688c7223",
  "mixHash": "0x06938c2999ecbeb79fdccae5d8a8560d9d66afc44354ca728973804bd931fc7d",
  "nonce": "0xf450a29159a3093e",
  "number": "0xb23eee",
  "parentHash": "0x21b5946db99a367e8812f791e56876ca01d9cd73bd4e351a85e8f980018e3be0",
  "receiptsRoot": "0x0081106086f32b182518d0998c066ecce6f445c7cf6631e13a8d8ba6f941ebbd",
  "sealFields": [
    "0xa006938c2999ecbeb79fdccae5d8a8560d9d66afc44354ca728973804bd931fc7d",
    "0x88f450a29159a3093e"
  ],
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0xcb1e",
  "stateRoot": "0x726c7063e07a04f161ab8ac261512c2a85b7dcdec05297c76b4908939e942011",
  "timestamp": "0x6005f60c",
  "totalDifficulty": "0x44b3ced6740cb09d925",
  "transactions": [
    "0xaa57bd9de2c89843065b4b308ad662cd5bc1063a170d8b6f00b210d99d74bbab",
    "0xbd4376500d6e54ea93eac89e65786d640920b21359754c85a2c559b5aa5f26f3"
  ],
  "transactionsRoot": "0x4dfff8e9046f4e65fbbd3b5df3b147215b9cfbc51c04b3f1c84687f104c92501",
  "uncles": []
}

index.html.txt

Actual behavior

NetworkError when attempting connect to fetch resource

System configuration

The example is executed in Firefox 84.0.2

Incubed version

3.2.0

Request

Incubed Configuration

{ chainId: 0x1, replaceLatestBlock: 6, requestCount: 3 }

Chain

0x1

@sattinos sattinos changed the title Firefox: NetworkError when attempting connect to fetch resource Firefox: Error: NetworkError when attempting to fetch resource Jan 18, 2021
@simon-jentzsch
Copy link
Contributor

Can you give some more details, like the console output or a way to reproduce it?
Also, did you run it in a https-enviroment? The reason why I'm asking is that there a few nodes in the nodelist only supporting http, which causes an exception in an https-enviroment, but incubed will then retry with a different node.

@sattinos
Copy link
Author

This is a sample that has exactly the same problem. It will run on Chrome only.

@simon-jentzsch
Copy link
Contributor

Thanks, I found the issue and fixed it.
The Problem was that the server the incubed nodes per default set the cors headers, but use
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept

But Firefox also sends the user-agent even if this would not be a allowed header and then complains about it. So I added the User-Agent as allowed header and now it works with firefox as well. The only issue is, that it may taks some time to update all the nodes.

@sattinos
Copy link
Author

After running:
npm upgrade in3-wasm
I was able to run the app from Firefox browser.
The issue is fixed now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants