web3.js icon indicating copy to clipboard operation
web3.js copied to clipboard

Ensure using `es6` for `web3.min.js`

Open Muhammad-Altabba opened this issue 1 year ago • 5 comments

Expected behavior

web3.min.js has syntax compatible with es6.

Actual behavior

The minified build (web3.min.js) contains the syntax ?. which is called Optional Chaining (https://2ality.com/2019/07/optional-chaining.html), that is es2020 which is far from es6 (ES2015).

Steps to reproduce the behavior

Check: https://github.com/web3/web3.js/issues/6472#issuecomment-1754098689

Logs

./node_modules/web3/dist/web3.min.js 4323:57
Module parse failed: Unexpected token (4323:57)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|                 b = f(y * v),
|                 E = f(h * v),
>                 _ = g.BASE.multiplyAndAddUnsafe(l, b, E)?.toAffine();
|               return !!_ && f(_.x) === h;
|             },

Environment

https://github.com/jasonhtpham/react-boilerplate

Muhammad-Altabba avatar Oct 24 '23 11:10 Muhammad-Altabba

yes. you are right. browsers support es6. es6+ are not fully supported.

avkos avatar Oct 24 '23 14:10 avkos

Moving it to backlog as internally created issue, and we can discuss it in backlog grooming call

jdevcs avatar Oct 30 '23 18:10 jdevcs

same issue

damianlluch avatar Feb 21 '24 14:02 damianlluch

@mconnelly8

jdevcs avatar Feb 22 '24 08:02 jdevcs

Hi, any news? I have same error.

gaisdav avatar Aug 05 '24 18:08 gaisdav