CCIP Read Error: unsupported protocol data
See original GitHub issueEthers 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:
- Created a year ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks. I’ll look into this shortly. 😃
Awesome! Thanks! 😃