리액트에서 caver js를 인스턴스화 할 시에 아래와 같은 웹팩관련된 오류가 뜨는데요
참고할만한 문서 없을까요.
node에서는 별 문제가 안생기는데 리액트에서 실행하려고하면 문제가 생기네요.
Compiled with problems:X
ERROR in ./node_modules/caver-js/packages/caver-core-requestmanager/caver-providers-http/src/index.js 31:13-28
Module not found: Error: Can’t resolve ‘http’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\caver-js\packages\caver-core-requestmanager\caver-providers-http\src’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “http”: require.resolve(“stream-http”) }’
- install ‘stream-http’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “http”: false }
ERROR in ./node_modules/caver-js/packages/caver-core-requestmanager/caver-providers-http/src/index.js 33:14-30
Module not found: Error: Can’t resolve ‘https’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\caver-js\packages\caver-core-requestmanager\caver-providers-http\src’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “https”: require.resolve(“https-browserify”) }’
- install ‘https-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “https”: false }
ERROR in ./node_modules/caver-js/packages/caver-ipfs/src/index.js 22:11-24
Module not found: Error: Can’t resolve ‘fs’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\caver-js\packages\caver-ipfs\src’
ERROR in ./node_modules/caver-js/packages/caver-klay/caver-klay-accounts/src/index.js 42:76-93
Module not found: Error: Can’t resolve ‘crypto’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\caver-js\packages\caver-klay\caver-klay-accounts\src’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “crypto”: require.resolve(“crypto-browserify”) }’
- install ‘crypto-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “crypto”: false }
ERROR in ./node_modules/caver-js/packages/caver-utils/randomhex/crypto.js 18:0-34
Module not found: Error: Can’t resolve ‘crypto’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\caver-js\packages\caver-utils\randomhex’
Did you mean ‘./crypto’?
Requests that should resolve in the current directory need to start with ‘./’.
Requests that start with a name are treated as module requests and resolve within module directories (node_modules, C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules).
If changing the source code is not an option there is also a resolve options called ‘preferRelative’ which tries to resolve these kind of requests in the current directory too.
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “crypto”: require.resolve(“crypto-browserify”) }’
- install ‘crypto-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “crypto”: false }
ERROR in ./node_modules/caver-js/packages/caver-wallet/src/keyring/keyringHelper.js 24:76-93
Module not found: Error: Can’t resolve ‘crypto’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\caver-js\packages\caver-wallet\src\keyring’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “crypto”: require.resolve(“crypto-browserify”) }’
- install ‘crypto-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “crypto”: false }
ERROR in ./node_modules/cipher-base/index.js 3:16-43
Module not found: Error: Can’t resolve ‘stream’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\cipher-base’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “stream”: require.resolve(“stream-browserify”) }’
- install ‘stream-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “stream”: false }
ERROR in ./node_modules/eth-lib/lib/bytes.js 7:193-227
Module not found: Error: Can’t resolve ‘crypto’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\eth-lib\lib’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “crypto”: require.resolve(“crypto-browserify”) }’
- install ‘crypto-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “crypto”: false }
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js 37:11-26
Module not found: Error: Can’t resolve ‘http’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\xhr2-cookies\dist’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “http”: require.resolve(“stream-http”) }’
- install ‘stream-http’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “http”: false }
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js 39:12-28
Module not found: Error: Can’t resolve ‘https’ in ‘C:\Users\doma\Documents\GitHub\thanks_carbon_nft\react-project\node_modules\xhr2-cookies\dist’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “https”: require.resolve(“https-browserify”) }’
- install ‘https-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “https”: false }