Cover-js 리액트에서 사용 시, 오류 file: Error: ENOENT: no such file or directory

안녕하세요.
리액트에서 caver-js 사용 하여 개발중인 개발자 입니다.
현재 리액트에서 react-app-rewired를 통해 호환은 성공하였습니다.
다만 아래와 같은 애러처럼 해당 파일을 찾지 못한다는 경고를 보여주고 있습니다

경로 /Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/는 개발중인 폴더위 위치이며, caver-js/node_modules/ 내부에 일부 폴더가 없다는 경고를 주고 있습니다.

일부 파일이 없다고 경고를 주고 있는 파일 리스트 입니다.

caver-js/node_modules/@ethersproject/abi/src.ts/_version.ts
caver-js/node_modules/@ethersproject/abi/src.ts/abi-coder.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/address.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/anonymous.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/array.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/boolean.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/bytes.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/fixed-bytes.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/null.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/number.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/string.ts
caver-js/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts
caver-js/node_modules/@ethersproject/abi/src.ts/fragments.ts
caver-js/node_modules/@ethersproject/abi/src.ts/index.ts
caver-js/node_modules/@ethersproject/abi/src.ts/interface.ts
node_modules/xhr2-cookies/errors.ts
node_modules/xhr2-cookies/index.ts
node_modules/xhr2-cookies/progress-event.ts
node_modules/xhr2-cookies/xml-http-request-event-target.ts
node_modules/xhr2-cookies/xml-http-request-upload.ts
node_modules/xhr2-cookies/xml-http-request.ts

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/_version.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/_version.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/_version.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/abi-coder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/abi-coder.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/abi-coder.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/address.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/address.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/address.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/anonymous.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/anonymous.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/array.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/array.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/array.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/boolean.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/boolean.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/bytes.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/bytes.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/fixed-bytes.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/fixed-bytes.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/null.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/null.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/null.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/number.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/number.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/number.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/string.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/string.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/string.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/fragments.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/fragments.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/fragments.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/index.ts'

WARNING in ./node_modules/caver-js/node_modules/@ethersproject/abi/lib.esm/interface.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/interface.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/caver-js/node_modules/@ethersproject/abi/src.ts/interface.ts'

WARNING in ./node_modules/xhr2-cookies/dist/errors.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/errors.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/errors.ts'

WARNING in ./node_modules/xhr2-cookies/dist/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/index.ts'

WARNING in ./node_modules/xhr2-cookies/dist/progress-event.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/progress-event.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/progress-event.ts'

WARNING in ./node_modules/xhr2-cookies/dist/xml-http-request-event-target.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/xml-http-request-event-target.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/xml-http-request-event-target.ts'

WARNING in ./node_modules/xhr2-cookies/dist/xml-http-request-upload.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/xml-http-request-upload.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/xml-http-request-upload.ts'

WARNING in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/xml-http-request.ts' file: Error: ENOENT: no such file or directory, open '/Users/choiwonhyeok/Documents/hallah/client/hallahdao_klaytn/node_modules/xhr2-cookies/xml-http-request.ts'

라이브러리 버젼 :

"dependencies" : {
    "caver-js": "^1.4.1",   
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
},
"devDependencies": {
    "react-app-rewired": "^2.2.1"
  }

위 버젼을 사용하고 있습니다.
전반적으로 caver-js 라이브러리를 사용은 할 순 있지만, 일부 메소드가 사용이 안되고 있어서, 이 문제 일까 싶어 해결을 하고자 합니다.

안녕하세요. caver-js 버전을 올린 이후에 한번 다시 테스트해보실 수 있으실까요?
참고로 최신 버전은 1.8.2입니다.

cover-js 뿐만 아니라, web3같은 라이브러리에서 동일한 문제가 있는걸로 보입니다.

  "scripts": {
    "start": "GENERATE_SOURCEMAP=false react-app-rewired start",
    "build": "react-app-rewired build",
    "test": "react-app-rewired test --env=jsdom",
    "eject": "react-app-rewired eject"
  },

리액트 npm start 명령어 앞에 "GENERATE_SOURCEMAP=false"을 붙히면서 해결이 되었습니다.

그래도 빠르게 답변해주셔서 너무 감사합니다

1 Like