小编jac*_*ose的帖子

“您需要适当的加载程序”,使用 react native 和 expo。应用程序无法在网络上编译,但在android上运行

我正在使用 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)

javascript reactjs webpack react-native expo

8
推荐指数
1
解决办法
2943
查看次数

标签 统计

expo ×1

javascript ×1

react-native ×1

reactjs ×1

webpack ×1