web3 / web3.js

Collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.
https://web3js.org/
Other
19.11k stars 4.89k forks source link

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

Open Muhammad-Altabba opened 10 months ago

Muhammad-Altabba commented 10 months ago

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

avkos commented 10 months ago

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

jdevcs commented 9 months ago

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

damianlluch commented 6 months ago

same issue

jdevcs commented 6 months ago

@mconnelly8

gaisdav commented 2 weeks ago

Hi, any news? I have same error.