我正在使用 react native expo。该应用程序在 android 上运行良好,但在网络上运行时出现编译错误。它之前工作正常,但我怀疑这是在安装一些新软件包后开始的。
/ReactNativeFrontend/node_modules/@codler/react-native-keyboard-aware-scroll-view/lib/KeyboardAwareHOC.js 13:12
Module parse failed: Unexpected token (13:12)
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
| } from 'react-native'
| import { isIphoneX } from 'react-native-iphone-x-helper'
> import type { KeyboardAwareInterface } from './KeyboardAwareInterface'
|
| const _KAM_DEFAULT_TAB_BAR_HEIGHT: number = isIphoneX() ? 83 : 49
Run Code Online (Sandbox Code Playgroud)
我的 babel 配置
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
}; …Run Code Online (Sandbox Code Playgroud)