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

✏️ [Documentation] - Update required packages #1384

Open
kinga112 opened this issue Aug 9, 2024 · 2 comments
Open

✏️ [Documentation] - Update required packages #1384

kinga112 opened this issue Aug 9, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@kinga112
Copy link

kinga112 commented Aug 9, 2024

Expected Behaviour

The quick start docs say I need these packages for react:
// Install Libraries
npm install @pushprotocol/restapi@latest @pushprotocol/socket@latest ethers@^5.7

Here are the errors when only installing these:

ERROR in ./node_modules/@ethereumjs/util/node_modules/micro-ftch/index.js 54:17-32
Module not found: Error: Can't resolve 'http'

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/@ethereumjs/util/node_modules/micro-ftch/index.js 55:18-34
Module not found: Error: Can't resolve 'https'

ERROR in ./node_modules/@ethereumjs/util/node_modules/micro-ftch/index.js 56:17-32
Module not found: Error: Can't resolve 'zlib'

ERROR in ./node_modules/@ethereumjs/util/node_modules/micro-ftch/index.js 58:36-50
Module not found: Error: Can't resolve 'url'

Current Behaviour

I cannot init user:
const userAlice = await PushAPI.initialize(signer, {
env: CONSTANTS.ENV.STAGING,
});

Steps to Reproduce

Follow quick start docs: install packages and initialize user random ethers wallet.
@kinga112 kinga112 added the documentation Improvements or additions to documentation label Aug 9, 2024
@kinga112 kinga112 changed the title ✏️ [Documentation/Readme Enhancement] - Update required packages ✏️ [Documentation] - Update required packages Aug 9, 2024
@kinga112
Copy link
Author

kinga112 commented Aug 9, 2024

It's a webpack issue, and I need to configure node externals for webpack.

@kinga112
Copy link
Author

kinga112 commented Aug 9, 2024

I added this to my webpack config:
resolve: { fallback: { "zlib": false, "http": false, "https": false, "crypto": false, "url": false, "crypto-browserify": require.resolve('crypto-browserify'), } },

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

No branches or pull requests

1 participant