- 제품 명 : caver-js
- 제품 버전 : 1.6.7
- OS환경 : Mac
- 내용 :
안녕하세요. https://docs.klaytn.com/dapp/sdk/caver-js/getting-started 따라 시작하다, 처음부터 진행이 되지 않아 질문 드립니다.
Invalid JSON RPC response: "" 문의 드립니다 보고 버전 문제인가 싶어 node version v14.16.0, 14.18.3, v16.13.1, v17.0.1 에서 테스트 하였지만 모두 같은 에러가 나왔습니다.
도움 부탁드립니다. 감사합니다.
// test.js
const Caver = require('caver-js')
const caver = new Caver('https://your.en.url:8651/')
async function testFunction() {
const version = await caver.rpc.klay.getClientVersion()
console.log(version)
}
testFunction()
결과
/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/caver-js/packages/caver-core-helpers/src/errors.js:92
return new Error(message)
^
Error: Invalid JSON RPC response: ""
at Object.InvalidResponse (/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/caver-js/packages/caver-core-helpers/src/errors.js:92:16)
at XMLHttpRequest.request.onreadystatechange (/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/caver-js/packages/caver-core-requestmanager/caver-providers-http/src/index.js:118:32)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
at XMLHttpRequest._setReadyState (/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
at XMLHttpRequest._onHttpRequestError (/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/xhr2-cookies/dist/xml-http-request.js:349:14)
at ClientRequest.<anonymous> (/Users/daeyeolkim/workspace/Bigsrun/bigsrun/node_modules/xhr2-cookies/dist/xml-http-request.js:252:61)
at ClientRequest.emit (node:events:390:28)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:164:8)