-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Angular 13 clean build is not working with web3.js #4767
Comments
I spent hours on same issue :( We need help asap. |
Same issue here |
Seems like there was a breaking change from angular 12 to 13. I'll look into this but if you want a version that works use angular 12 for now |
Sorry, its not a breaking change from angular 12 to angular 13, something broke when web3 upgraded from 1.6.1 to 1.7.0 related to #4756. Until there is a fix the solution would be instead of using |
We already use import statement and issue is exist on Angular 12 as well :( |
I was able to make it run. Unfortunately there's some warnings popping out :
Here's a sample repo, unfortunately I had to upload it to the cloud since I can't attach zip files for some reason. OneDrive link |
hmmmm @YakupIpek do you get the same error as @ExtremeSwat? You can try out his solution, or downgrade the version of web3js to 1.6.1 |
@luu-alex This is what i get after installing those packages. I will try to downgrade to 1.6.1
|
@luu-alex |
@YakupIpek you should be able to import types like contract, 1.6.1 has it https://github.com/ChainSafe/web3.js/blob/release/1.6.1/packages/web3-eth-contract/types/index.d.ts#L25 |
Is there an existing issue for this?
Current Behavior
After following the instructions mentioned for Angular versions >= 11 I still can't ng-serve ng-build
Expected Behavior
to be able to ng-serve
Steps to Reproduce
After installing web3js off npm, I've also installed the other packages:
npm install --save-dev crypto-browserify stream-browserify assert stream-http https-browserify os-browserify
Added within tsconfig.json the following:
And finally in the polyfills.ts the following:
import { Buffer } from 'buffer';
As far as I can see it fails in the polyfills.ts with:
Error: src/polyfills.ts:56:2 - error TS2304: Cannot find name 'global'.
Web3.js Version
1.7.0
Environment
Anything Else?
Added a zip file of my repo sample:
https://1drv.ms/u/s!Av4UoFRH90CIhZAQ4ISteiR6hbRdNQ?e=i4oAOQ
The text was updated successfully, but these errors were encountered: