web3.js
web3.js copied to clipboard
Ensure using `es6` for `web3.min.js`
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
yes. you are right. browsers support es6. es6+ are not fully supported.
Moving it to backlog as internally created issue, and we can discuss it in backlog grooming call
same issue
@mconnelly8
Hi, any news? I have same error.