Truffle에서 cypress 접근시 에러

PS C:\Users\JYAHN\Desktop\jeannft\console> truffle console --network cypress

C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\eachOfLimit.js:61
callback(null);
^
Error: When requesting the chain id from the node, itreturned the malformed result undefined.
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\truffle-hdwallet-provider-klaytn\src\index.ts:232:19
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules@trufflesuite\web3-provider-engine\index.js:240:9
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\once.js:12:16
at replenish (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\eachOfLimit.js:61:25)
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\eachOfLimit.js:71:9
at eachLimit (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\eachLimit.js:43:36)
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\async\internal\doLimit.js:9:16
at end (C:\Users\JYAHN\Desktop\jeannft\console\node_modules@trufflesuite\web3-provider-engine\index.js:217:5)
at C:\Users\JYAHN\Desktop\jeannft\console\node_modules\truffle-hdwallet-provider-klaytn\dist\subproviders\provider.js:19:5
at XMLHttpRequest.request.onreadystatechange (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\caver-js\packages\caver-core-requestmanager\caver-providers-http\src\index.js:122:13)
at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request.ts:345:8)
at IncomingMessage. (C:\Users\JYAHN\Desktop\jeannft\console\node_modules\xhr2-cookies\xml-http-request.ts:311:39)
at IncomingMessage.emit (events.js:387:35)
at IncomingMessage.emit (domain.js:470:12)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)

truffle에서 cypress 콘솔에 접근하려고 하면 이런 에러가 납니다. deploy할 때도 마찬가지입니다.

truffle-config.js 내용은 아래와 같습니다.

cypress: {

  provider: () => {

    const option = {

      headers: [

        {

          name: "Authorization",

          value: "Basic " + kas,

        },

        { name: "x-chain-id", value: "8217" },

      ],

      keepAlive: false,

    };

    return new HDWalletProvider(

      privateKey,

      new Caver.providers.HttpProvider(

        "https://node-api.klaytnapi.com/v1/klaytn",

        option

      )

    );

  },

  network_id: "8217", //Klaytn baobab testnet's network id

  gas: "850000000",

  gasPrice: "25000000000",

},

baobab은 접속이 잘 됩니다.

안녕하세요,
KAS 제품팀입니다.

해당 내용은 내부 확인 후 답변드릴 수 있도록 하겠습니다.

감사합니다.

KAS 제품팀 드림,

자답입니다.
value: "Basic " + kas, 이 부분에서 kas에 이미 Basic xxx…으로 값이 들어있어서
value가 Basic Basic xxx… 이렇게 들어가는 문제였네요.

1개의 좋아요

@sunya7a
문제가 잘 해결되어 다행입니다 :slight_smile:
해결 과정을 공유해주셔서 감사합니다.