看起来Expo Webpack不是optional chaining。
我在尝试将UI Kitten安装到Expo Web应用程序时发现了此问题。
将UI Kitten添加到新创建的Expo应用程序后,这是编译错误
node_modules/@ui-kitten/components/ui/input/input.component.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.org/concepts#loaders
| this.webEventResponder = devsupport_1.WebEventResponder.create(this);
| this.focus = () => {
> this.textInputRef.current?.focus();
| };
| this.blur = () => {
Deps版本(目前我在这里写的是最新版本。)
[email protected]
@ui-kitten/[email protected]
有什么技巧可以解决吗?
最佳答案
Webpack使用Acorn解析器和Acorn does not support optional chaining as of now。
有一个pending pull request which you can subscribe to to get notified about the progress。
因此,您的解决方法是:
关于javascript - Expo Web无法编译 "optional chaining",我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/61124258/