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

Fix/issue 20 #37

Merged
merged 3 commits into from
Mar 9, 2023
Merged

Fix/issue 20 #37

merged 3 commits into from
Mar 9, 2023

Conversation

Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Mar 9, 2023

fix for issue#20

Issue 1 - Module not found: Can't resolve 'crypto'

WARNING in ./node_modules/@lit-protocol/encryption/src/index.js 14:22-49
Module not found: Error: Can't resolve 'crypto' in '/Users/anson/Projects/test/webpack-issue-20/node_modules/@lit-protocol/encryption/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 }

WARNING in ./node_modules/@lit-protocol/lit-node-client/src/index.js 158:22-49
Module not found: Error: Can't resolve 'crypto' in '/Users/anson/Projects/test/webpack-issue-20/node_modules/@lit-protocol/lit-node-client/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 }

Solution

fix: Module not found: Can't resolve 'crypto'

Add the following to package.json

  "browser": {
    "crypto": false,
    "stream": false
  },

Issue 2 -

WARNING in ./node_modules/@lit-protocol/ecdsa-sdk/src/lib/ecdsa-sdk.js 312:16-55
Critical dependency: the request of a dependency is an expression

Solution

fix: the request of a dependency is an expression

webpack can’t resolve the require statically and imports the entire package, and the problem is due to this line

@Ansonhkg
Copy link
Collaborator Author

Ansonhkg commented Mar 9, 2023

currently it's being tested on @dev tag or 2.1.54

to test:

yarn add @lit-protocol/lit-node-client@2.1.54

@Ansonhkg Ansonhkg requested review from glitch003 and DashKash54 March 9, 2023 15:10
@Ansonhkg Ansonhkg merged commit e42fe2a into master Mar 9, 2023
@Ansonhkg Ansonhkg mentioned this pull request May 4, 2023
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

Successfully merging this pull request may close these issues.

1 participant