admin管理员组文章数量:1277887
Looks like Expo Webpack doesn't optional chaining.
I found this when I tried to install UI Kitten to Expo Web app.
This is the pile error after I added UI Kitten to the newly created Expo app
node_modules/@ui-kitten/ponents/ui/input/inputponent.js 104:38
Module parse failed: Unexpected token (104:38)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See
| this.webEventResponder = devsupport_1.WebEventResponder.create(this);
| this.focus = () => {
> this.textInputRef.current?.focus();
| };
| this.blur = () => {
Deps versions(latest ones at the moment that I'm writing here.)
[email protected]
@ui-kitten/[email protected]
Any tips to hack around this?
Looks like Expo Webpack doesn't optional chaining.
I found this when I tried to install UI Kitten to Expo Web app.
This is the pile error after I added UI Kitten to the newly created Expo app
node_modules/@ui-kitten/ponents/ui/input/input.ponent.js 104:38
Module parse failed: Unexpected token (104:38)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js/concepts#loaders
| this.webEventResponder = devsupport_1.WebEventResponder.create(this);
| this.focus = () => {
> this.textInputRef.current?.focus();
| };
| this.blur = () => {
Deps versions(latest ones at the moment that I'm writing here.)
[email protected]
@ui-kitten/[email protected]
Any tips to hack around this?
Share Improve this question asked Apr 9, 2020 at 15:05 sujameslinsujameslin 1811 silver badge7 bronze badges2 Answers
Reset to default 5Webpack uses Acorn parser, and Acorn does not support optional chaining as of now.
There is a pending pull request which you can subscribe to to get notified about the progress.
So your workaround options are:
- do not use webpack
- do not use optional chaining
- integrate Babel into your stack, and make sure to pass all *.js-files through Babel first, using this Babel plugin
- wait for the aforementioned PR to be merged and the next version including this PR to be released
- fork Acorn, merge the PR yourself, then fork webpack and make it use your forked Acorn
As @connexo says, the workaround is to integrate a babel plugin. Also, this issue has already been discussed on the github.
本文标签: javascriptExpo Web failed to compile quotoptional chainingquotStack Overflow
版权声明:本文标题:javascript - Expo Web failed to compile "optional chaining" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741287471a2370354.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论