ethereum-boilerplate: ERROR: no-unsafe-optional-chaining
I followed the setup instructions exactly but I get the error:
ERROR in src/components/Contract/Contract.jsx
Line 90:34: Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError no-unsafe-optional-chaining
I also get 99 warnings about URLs that look like:
WARNING in ./node_modules/antd/dist/antd.css (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js!./node_modules/antd/dist/antd.css)
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map: 'webpack://antd/./components/time-picker/style/index.less' URL is not supported
@ ./node_modules/antd/dist/antd.css 8:6-231 22:17-24 26:7-21 58:25-39 59:36-47 59:50-64 63:6-73:7 64:54-65 64:68-82 70:42-53 70:56-70 72:21-28 83:0-201 83:0-201 84:22-29 84:33-47 84:50-64 61:4-74:5
@ ./src/App.jsx 18:0-28
@ ./src/index.js 6:0-24 24:35-38
I have uninstalled and reinstalled yarn, and deleted and redid the ethereum-boilerplate setup. No matter what, I get 99 warnings and this error. I am on Manjaro Linux.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17
Change
for (let method of contract?.abi )tofor (let method of contract?.abi ?? method)It works for me. macOS Monterey
The errors magically stopped, but it was all pretty buggy and would randomly crash.
I ended up just building my own thing from scratch. It was faster than trying to get this working
yarn global add typescript@latest use this command to update your typescript version. It worked for me.
Thank you @wjy8888840 for the workaround.
I’ve raised a PR to resolve this #139