question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CCIP Read Error: unsupported protocol data

See original GitHub issue

Ethers Version

5.7.0

Search Terms

unsupported protocol data UNSUPPORTED_OPERATION

Describe the Problem

While using the nodejs implementation, resolving a CCIP domain configured with data:uri as a gateway URL throws an UNSUPPORTED_OPERATION exception.

In this example, 0.bensyc.eth is attempting to fetch ENS records from another .eth domain.

However, this does appear to work in a browser, just not with server side nodejs.

Code Snippet

const { ethers } = require("ethers");

infura = new ethers.providers.InfuraProvider("mainnet", {
  projectId: "",
});

async function getDomain() {
  let resolver = await infura.getResolver("0.bensyc.eth");
  resolver.getAddress().then(console.log);
  resolver.getContentHash().then(console.log);
}

getDomain()

Errors

/home/user/node_modules/@ethersproject/logger/lib/index.js:238
        var error = new Error(message);
                    ^

Error: missing response (requestBody=null, requestMethod="GET", serverError={"reason":"unsupported protocol data:","code":"UNSUPPORTED_OPERATION","protocol":"data:","operation":"request"}, url="data:text/plain,{\"data\":\"0x000000000000000000000000edc21400dafd1cba357cbe99d56197c20da51d37\"}", code=SERVER_ERROR, version=web/5.7.0)
    at Logger.makeError (/home/user/node_modules/@ethersproject/logger/lib/index.js:238:21)
    at Logger.throwError (/home/user/node_modules/@ethersproject/logger/lib/index.js:247:20)
    at /home/user/node_modules/@ethersproject/web/lib/index.js:255:36
    at step (/home/user/node_modules/@ethersproject/web/lib/index.js:33:23)
    at Object.throw (/home/user/node_modules/@ethersproject/web/lib/index.js:14:53)
    at rejected (/home/user/node_modules/@ethersproject/web/lib/index.js:6:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  reason: 'missing response',
  code: 'SERVER_ERROR',
  requestBody: null,
  requestMethod: 'GET',
  serverError: Error: unsupported protocol data: (protocol="data:", operation="request", code=UNSUPPORTED_OPERATION, version=web/5.7.0)
      at Logger.makeError (/home/user/node_modules/@ethersproject/logger/lib/index.js:238:21)
      at Logger.throwError (/home/user/node_modules/@ethersproject/logger/lib/index.js:247:20)
      at /home/user/node_modules/@ethersproject/web/lib/geturl.js:130:36
      at step (/home/user/node_modules/@ethersproject/web/lib/geturl.js:33:23)
      at Object.next (/home/user/node_modules/@ethersproject/web/lib/geturl.js:14:53)
      at /home/user/node_modules/@ethersproject/web/lib/geturl.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (/home/user/node_modules/@ethersproject/web/lib/geturl.js:4:12)
      at getUrl (/home/user/node_modules/@ethersproject/web/lib/geturl.js:100:12)
      at /home/user/node_modules/@ethersproject/web/lib/index.js:214:66 {
    reason: 'unsupported protocol data:',
    code: 'UNSUPPORTED_OPERATION',
    protocol: 'data:',
    operation: 'request'
  },
  url: 'data:text/plain,{"data":"0x000000000000000000000000edc21400dafd1cba357cbe99d56197c20da51d37"}'
}


### Environment

node.js (v12 or newer)

### Environment (Other)

_No response_

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Sep 9, 2022

Thanks. I’ll look into this shortly. 😃

0reactions
ricmoocommented, Sep 15, 2022

Awesome! Thanks! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

BoredENSYachtClub.eth | BENSYC.eth on Twitter: "☠️BENSYC ...
CCIP Read Error: unsupported protocol data · Issue #3341 · ethers-io/ethers.js. Ethers Version 5.7.0 Search Terms unsupported protocol data ...
Read more >
“Unsupported protocol in URL” reading XML from a URI
Error “Unsupported protocol in URL” is thrown when trying to access a URI using the X-DOC:LOAD method. The application is trying to get...
Read more >
EIP-3668: CCIP Read: Secure offchain data retrieval
A CCIP read enabled contract MUST revert with the following error whenever a function that requires offchain data is called:.
Read more >
Catalyst 4500 Series Switch Cisco IOS System Message Guide
Error Message C4K_CHASSIS-3-FANTRAYSEEPROMINVALID: Invalid fan tray seeprom data. Explanation A failure occurred while reading the system fan tray serial ...
Read more >
Connection closed due to error Error: Unsupported protocol ...
You have made a mistake in your pasting API key. Check your API key it will not be like URL. http:// is missing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found