Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 对拖运不起作用作出反应,抛出一些装载机问题_Reactjs_React Native_Webpack - Fatal编程技术网

Reactjs 对拖运不起作用作出反应,抛出一些装载机问题

Reactjs 对拖运不起作用作出反应,抛出一些装载机问题,reactjs,react-native,webpack,Reactjs,React Native,Webpack,我已经将HALL添加到我的react原生项目中,以分析我的发布版本失败的原因。但我却遇到了另一个问题。我有一个带有以下配置的webpack.haul.js module.exports = { entry: './index.js', }; 当我运行react native run android时,我看到以下错误。谁能帮帮我吗 ERROR Failed to compile. ./node_modules/native-base-shoutem-theme/src/StylePr

我已经将HALL添加到我的react原生项目中,以分析我的发布版本失败的原因。但我却遇到了另一个问题。我有一个带有以下配置的webpack.haul.js

module.exports = {
    entry: './index.js',
};
当我运行react native run android时,我看到以下错误。谁能帮帮我吗

ERROR  Failed to compile.

./node_modules/native-base-shoutem-theme/src/StyleProvider.js 10:19
Module parse failed: Unexpected token (10:19)
You may need an appropriate loader to handle this file type.
|  */
| export default class StyleProvider extends React.Component {
>   static propTypes = {
|     children: PropTypes.element.isRequired,
|     style: PropTypes.object,
@ ./node_modules/native-base-shoutem-theme/index.js 3:0-48 7:0-15:2
@ ./node_modules/native-base/dist/src/index.js
@ ./screens/Academics/HomeWorkScreen.js
@ ./App.js
@ ./index.js
@ multi ./node_modules/haul/src/vendor/polyfills/Object.es6.js ./node_modules/haul/src/vendor/polyfills/console.js ./node_modules/haul/src/vendor/polyfills/error-guard.js ./node_modules/haul/src/vendor/polyfills/Number.es6.js ./node_modules/haul/src/vendor/polyfills/String.prototype.es6.js ./node_modules/haul/src/vendor/polyfills/Array.prototype.es6.js ./node_modules/haul/src/vendor/polyfills/Array.es6.js ./node_modules/haul/src/vendor/polyfills/Object.es7.js ./node_modules/haul/src/vendor/polyfills/babelHelpers.js ./node_modules/react-native/Libraries/Core/InitializeCore.js ./node_modules/haul/src/utils/polyfillEnvironment.js ./index.js

./node_modules/native-base-shoutem-theme/src/connectStyle.js 116:26
Module parse failed: Unexpected token (116:26)
You may need an appropriate loader to handle this file type.
| 
|     class StyledComponent extends React.Component {
>       static contextTypes = {
|         theme: ThemeShape,
|         // The style inherited from the parent
@ ./node_modules/native-base-shoutem-theme/index.js 1:0-46 7:0-15:2
@ ./node_modules/native-base/dist/src/index.js
@ ./screens/Academics/HomeWorkScreen.js
@ ./App.js
@ ./index.js
@ multi ./node_modules/haul/src/vendor/polyfills/Object.es6.js ./node_modules/haul/src/vendor/polyfills/console.js ./node_modules/haul/src/vendor/polyfills/error-guard.js ./node_modules/haul/src/vendor/polyfills/Number.es6.js ./node_modules/haul/src/vendor/polyfills/String.prototype.es6.js ./node_modules/haul/src/vendor/polyfills/Array.prototype.es6.js ./node_modules/haul/src/vendor/polyfills/Array.es6.js ./node_modules/haul/src/vendor/polyfills/Object.es7.js ./node_modules/haul/src/vendor/polyfills/babelHelpers.js ./node_modules/react-native/Libraries/Core/InitializeCore.js ./node_modules/haul/src/utils/polyfillEnvironment.js ./index.js

./node_modules/rn-fetch-blob/index.js 13:12
Module parse failed: Unexpected token (13:12)
You may need an appropriate loader to handle this file type.
|   AppState,
| } from 'react-native'
> import type {
|   RNFetchBlobNative,
|   RNFetchBlobConfig,
@ ./screens/Academics/HomeWorkScreen.js 1:603-627
@ ./App.js
@ ./index.js
@ multi ./node_modules/haul/src/vendor/polyfills/Object.es6.js ./node_modules/haul/src/vendor/polyfills/console.js ./node_modules/haul/src/vendor/polyfills/error-guard.js ./node_modules/haul/src/vendor/polyfills/Number.es6.js ./node_modules/haul/src/vendor/polyfills/String.prototype.es6.js ./node_modules/haul/src/vendor/polyfills/Array.prototype.es6.js ./node_modules/haul/src/vendor/polyfills/Array.es6.js ./node_modules/haul/src/vendor/polyfills/Object.es7.js ./node_modules/haul/src/vendor/polyfills/babelHelpers.js ./node_modules/react-native/Libraries/Core/InitializeCore.js ./node_modules/haul/src/utils/polyfillEnvironment.js ./index.js


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleDemshReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

您的问题是,不知何故,babel没有正确配置以编译这些错误中提到的代码中存在的特性

具体问题:

  • 静态方法属性(您需要)
  • 流类型(您需要)
  • 很难说您的配置到底出了什么问题,但更快的测试方法是直接在这些文件上运行babel CLI。如果您确保
    BABEL_ENV
    和任何其他BABEL cli/ENV/API标志的设置方式与webpack构建中的设置方式相同(您可能需要进行一些调试以找到应用
    BABEL loader
    的位置),您可以执行例如
    运行BABEL node_模块/native base Shootem主题/src/StyleProvider.js

    如果你能像这样重现这个问题,你可以用你的巴贝尔配置在一个非常tigher的循环中进行实验,直到你找到一个解决方案


    更新babel和您安装的所有预设/插件是一个很好的起点。

    您找到解决方案了吗?您好,我在./node_modules/rn fetch blob/index.js 13:12模块解析失败:意外令牌(13:12)您可能需要适当的加载程序来处理此文件类型。|AppState,|}来自'react native'>导入类型{| RNFetchBlobNative,| RNFetchBlobConfig,