Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack 5.59.0 compiled with 9 errors #1

Open
phohtoo opened this issue Oct 24, 2021 · 2 comments
Open

webpack 5.59.0 compiled with 9 errors #1

phohtoo opened this issue Oct 24, 2021 · 2 comments

Comments

@phohtoo
Copy link

phohtoo commented Oct 24, 2021

I am getting below errors while trying to run npm start. I am getting similar error with npm v7 and v8 too. I have downgraded my npm to 6.14.15 since package-lock.json is generated with "lockfileVersion": 1. thanks

node: v16.12.0
npm/npx: 6.14.15 
35 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

ERROR in ./node_modules/aws-sdk/lib/event_listeners.js 580:21-44
Module not found: Error: Can't resolve 'util' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/aws-sdk/lib'
Did you mean './util'?
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, /home/linnhtoo/affinidi-drivinglicense-holder/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: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
 @ ./node_modules/aws-sdk/lib/core.js 92:0-28
 @ ./node_modules/aws-sdk/lib/browser.js 3:10-27
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/services/CognitoService.js 64:12-30
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/dangerous.js 14:41-77
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/index.js 50:33-55
 @ ./src/utils/sdkService.js 4:0-56 15:4-15
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/cipher-base/index.js 3:16-43
Module not found: Error: Can't resolve 'stream' in '/home/linnhtoo/affinidi-drivinglicense-holder/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 }
 @ ./node_modules/create-hash/browser.js 11:11-33
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/services/WalletStorageService.js 70:19-41
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/dangerous.js 18:47-89
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/index.js 50:33-55
 @ ./src/utils/sdkService.js 4:0-56 15:4-15
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/dotenv/lib/main.js 24:11-24
Module not found: Error: Can't resolve 'fs' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/dotenv/lib'
 @ ./src/config.js 4:0-32 5:0-6
 @ ./src/utils/sdkService.js 7:0-31 17:7-17 18:10-23
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/dotenv/lib/main.js 26:13-28
Module not found: Error: Can't resolve 'path' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/dotenv/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: { "path": require.resolve("path-browserify") }'
        - install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "path": false }
 @ ./src/config.js 4:0-32 5:0-6
 @ ./src/utils/sdkService.js 7:0-31 17:7-17 18:10-23
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/eccrypto-js/dist/cjs/lib/node.js 13:33-50
Module not found: Error: Can't resolve 'crypto' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/eccrypto-js/dist/cjs/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 }
 @ ./node_modules/eccrypto-js/dist/cjs/aes.js 43:15-36
 @ ./node_modules/eccrypto-js/dist/cjs/index.js 15:9-25
 @ ./node_modules/@affinidi/wallet-browser-sdk/dist/services/KeysService.js 77:30-52
 @ ./node_modules/@affinidi/wallet-browser-sdk/dist/AffinityWallet.js 50:38-71
 @ ./node_modules/@affinidi/wallet-browser-sdk/dist/index.js 22:23-50
 @ ./src/utils/sdkService.js 3:0-72 27:20-51 40:15-21
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/ethereumjs-util/dist/index.js 17:13-30
Module not found: Error: Can't resolve 'assert' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/ethereumjs-util/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: { "assert": require.resolve("assert/") }'
        - install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "assert": false }
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/services/WalletStorageService.js 54:26-52
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/dangerous.js 18:47-89
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/index.js 50:33-55
 @ ./src/utils/sdkService.js 4:0-56 15:4-15
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/keccak/lib/api/keccak.js 3:4-21
Module not found: Error: Can't resolve 'stream' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/keccak/lib/api'

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 }
 @ ./node_modules/keccak/lib/api/index.js 1:21-40
 @ ./node_modules/keccak/js.js 1:17-37
 @ ./node_modules/keccak256/dist/index.js 9:23-40
 @ ./node_modules/@affinidi/common/dist/services/DidDocumentService/JoloDidDocument.js 51:18-38
 @ ./node_modules/@affinidi/common/dist/services/DidDocumentService/index.js 45:42-70
 @ ./node_modules/@affinidi/common/dist/services/JwtService.js 45:45-76
 @ ./src/utils/sdkService.js 5:0-67 41:26-36 142:11-29
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/keccak/lib/api/shake.js 3:4-21
Module not found: Error: Can't resolve 'stream' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/keccak/lib/api'

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 }
 @ ./node_modules/keccak/lib/api/index.js 3:20-38
 @ ./node_modules/keccak/js.js 1:17-37
 @ ./node_modules/keccak256/dist/index.js 9:23-40
 @ ./node_modules/@affinidi/common/dist/services/DidDocumentService/JoloDidDocument.js 51:18-38
 @ ./node_modules/@affinidi/common/dist/services/DidDocumentService/index.js 45:42-70
 @ ./node_modules/@affinidi/common/dist/services/JwtService.js 45:45-76
 @ ./src/utils/sdkService.js 5:0-67 41:26-36 142:11-29
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

ERROR in ./node_modules/serialize-error/index.js 5:4-19
Module not found: Error: Can't resolve 'util' in '/home/linnhtoo/affinidi-drivinglicense-holder/node_modules/serialize-error'

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: { "util": require.resolve("util/") }'
        - install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "util": false }
 @ ./node_modules/jsonld-signatures/lib/ProofSet.js 17:4-30
 @ ./node_modules/jsonld-signatures/lib/jsonld-signatures.js 15:17-38
 @ ./node_modules/@affinidi/vc-common/dist/vc-common.esm.js 440:25-53 793:27-55 885:27-55
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/CommonNetworkMember.js 59:20-50
 @ ./node_modules/@affinidi/wallet-core-sdk/dist/index.js 41:28-60
 @ ./src/utils/sdkService.js 4:0-56 15:4-15
 @ ./src/App.js 13:0-44 19:19-29
 @ ./src/index.js 6:0-24 16:36-39

9 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.59.0 compiled with 9 errors and 36 warnings in 55632 ms
@launganik
Copy link

Thanks for reporting @phohtoo. Can you try to delete node-modules & package-lock.json and try again?

@shubhamAffinidi meanwhile, can you please check this issue?

@shubhamAffinidi
Copy link
Contributor

@phohtoo Thanks for raising this. Please downgrade the react-scripts version to 4x for your instant fix.
We will be releasing a fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@phohtoo @launganik @shubhamAffinidi and others