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

Not Compatible with Webpack 5 #992

Closed
aaely opened this issue Jan 18, 2022 · 8 comments
Closed

Not Compatible with Webpack 5 #992

aaely opened this issue Jan 18, 2022 · 8 comments

Comments

@aaely
Copy link

aaely commented Jan 18, 2022

New creat-react-apps are being forced onto webpack v 5.66 and its causing issues with instantiating a new cosmJS signing client. Create-react-app is preventing me from downgrading effectively and this is a major holdup. Im leaving the error message here but its honestly rather worthless.

image

@webmaster128
Copy link
Member

The error message is pretty good and explains well what the problem is and how to solve it.

CosmJS works with webpack 5 but due to dependencies we use, you have to configure webpack. Here is a webpack config that we use which solves the problems above: https://github.com/cosmos/cosmjs/blob/main/packages/stargate/webpack.web.config.js#L25-L38.

Can you create a custom pabpack config in CRA?

@aaely
Copy link
Author

aaely commented Jan 18, 2022

Adding the polyfills and fixing this breaks polkadot-js. I have them integrated and am using the two on the same platform along with Solana and Eth.

Leaving this broken allows polkadot-js to work but these break.

@webmaster128
Copy link
Member

Which of those configs makes prokadot-js break and how? Maybe we can change them a bit or get rid of some dependencies that make the config necessary.

@aaely
Copy link
Author

aaely commented Jan 19, 2022

Upon further investigation, it appears to be Web3.js that has the breaking issue. CosmJS and Polkadot-js are compatible; however, react has made this much more difficult to achieve.

@webmaster128
Copy link
Member

Yeah, requiring this webpack config entries is far from ideal. We already put effort into reducing the dependencies. But the reality is that many of the npm modules used today were written for Node.js long time ago and still assume the Node environment is available.

@webmaster128
Copy link
Member

With #966 we seem to get rid of the stream fallback requirement 🎉.

@webmaster128
Copy link
Member

See also #1061

@webmaster128
Copy link
Member

#1088 adds documentation how Webpack 5 needs to be configured to allow using CosmJS smoothly.

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

2 participants