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

web3.min.js is broken in 1.2.3 and 1.2.4 #3222

Closed
PaterSantyago opened this issue Nov 19, 2019 · 5 comments
Closed

web3.min.js is broken in 1.2.3 and 1.2.4 #3222

PaterSantyago opened this issue Nov 19, 2019 · 5 comments

Comments

@PaterSantyago
Copy link

web3.min.js from dist folder are broken in versions 1.2.3 and 1.2.4.

Google Chrome (78.0.3904.108) on Mac OS produces "require is not defined at web3.min.js:1" error.

Everything work fine with 1.2.2

Also, I'm getting same error for 1.2.3 and 1.2.4 if I build web3.min.js with npm run-script build

@PaterSantyago PaterSantyago changed the title web3.min.js if broken in 1.2.3 and 1.2.4 web3.min.js is broken in 1.2.3 and 1.2.4 Nov 19, 2019
@nivida
Copy link
Contributor

nivida commented Nov 19, 2019

Thanks for opening this issue! The minified file was only existing for version 1.2.2 because we had defined the browser property to point on the minified dist files. This browser property got removed because it blocked some projects from bundling their apps in an optimized way.
I'm currently improving the whole build pipeline of web3.js with PR #3160 this PR will define the unpkg and jsdelivr property in the package.json file of each package of web3.

@nivida nivida closed this as completed Nov 19, 2019
@nivida
Copy link
Contributor

nivida commented Nov 19, 2019

Also, I'm getting same error for 1.2.3 and 1.2.4 if I build web3.min.js with npm run-script build

Sorry I've forgotten to answer this. You would have to run npm run build-all but the minified file is existing in the web3 package dist folder.

@DurandA
Copy link

DurandA commented Nov 29, 2019

@nivida I have the same issue with dist/web3.min.js from 1.2.4 or built from 1.x branch. Is there any place I can get a clean version working in the browser until this is fixed?

@munawarb
Copy link

munawarb commented Dec 3, 2019

Hi @DurandA,
You can just grab web3.min.js from web3 1.2.2. So in my project I'm using 1.2.4 on the Node side and 1.2.2 on the browser side. This works. I'm glad I found your issue, I wondering for the longest time why web3.min.js was throwing the error and thought I was going crazy when no one else seemed to be having this problem :).

@munawarb
Copy link

munawarb commented Dec 4, 2019

Hi @DurandA,
Not sure, but downgrading to 1.2.2 on the browser side will work fine. You'll just need to include the polyfill.min.js file mentioned in #3155.

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

4 participants