Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-Native工程启动报错 #4082

Closed
flingInTheSky opened this issue Aug 6, 2019 · 6 comments
Closed

React-Native工程启动报错 #4082

flingInTheSky opened this issue Aug 6, 2019 · 6 comments
Assignees

Comments

@flingInTheSky
Copy link

flingInTheSky commented Aug 6, 2019

问题描述
创建好demo工程,运行taro-native-shell iOS工程,启动React-Native。报错

复现步骤
[复现问题的步骤]

  1. taro init taroDemo

是否需要使用 TypeScript ? No
请选择 CSS 预处理器(Sass/Less/Stylus) 无(选择Sass也一样)
请选择模板 默认模板 (选择mox也一样)
3.npm run dev:rn,可以正常编译、启动
4.运行taro-native-shell APP,报错

期望行为
正常运行、调试React-Native

报错信息

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

This error is located at:
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:32)

throwOnInvalidElementType
    ReactNativeRenderer-dev.js:4706:4
createFiberFromElement
    ReactNativeRenderer-dev.js:4663:42
reconcileSingleElement
    ReactNativeRenderer-dev.js:8338:8
reconcileChildFibers
    ReactNativeRenderer-dev.js:8422:14
reconcileChildrenAtExpirationTime
    ReactNativeRenderer-dev.js:8622:8
reconcileChildren
    ReactNativeRenderer-dev.js:8603:6
updateHostComponent
    ReactNativeRenderer-dev.js:9001:22
performUnitOfWork
    ReactNativeRenderer-dev.js:12924:25
workLoop
    ReactNativeRenderer-dev.js:12953:43
renderRoot
    ReactNativeRenderer-dev.js:12996:17
performWorkOnRoot
    ReactNativeRenderer-dev.js:13632:34
performWork
    ReactNativeRenderer-dev.js:13545:26
performSyncWork
    ReactNativeRenderer-dev.js:13506:16
requestWork
    ReactNativeRenderer-dev.js:13392:6
scheduleWorkImpl
    ReactNativeRenderer-dev.js:13259:24
scheduleRootUpdate
    ReactNativeRenderer-dev.js:13930:17
render
    ReactNativeRenderer-dev.js:14726:35
renderApplication
    renderApplication.js:49:21
runApplication
    AppRegistry.js:194:26
__callFunction
    MessageQueue.js:351:47
<unknown>
    MessageQueue.js:116:26
__guardSafe
    MessageQueue.js:314:6
callFunctionReturnFlushedQueue
    MessageQueue.js:115:17
callFunctionReturnFlushedQueue
    [native code]:0

系统信息

Taro v1.2 及以上版本已添加 taro info 命令,方便大家查看系统及依赖信息,运行该命令后将结果贴下面即可。

👽 Taro v1.3.11


  Taro CLI 1.3.11 environment info:
    System:
      OS: macOS High Sierra 10.13.6
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.7.0 - /usr/local/bin/node
      npm: 6.10.0 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 1.3.11 => 1.3.11 
      @tarojs/components-rn: ^1.3.11 => 1.3.12 
      @tarojs/plugin-babel: 1.3.11 => 1.3.11 
      @tarojs/plugin-csso: 1.3.11 => 1.3.11 
      @tarojs/plugin-uglifyjs: 1.3.11 => 1.3.11 
      @tarojs/router: 1.3.11 => 1.3.11 
      @tarojs/taro: 1.3.11 => 1.3.11 
      @tarojs/taro-alipay: 1.3.11 => 1.3.11 
      @tarojs/taro-h5: 1.3.11 => 1.3.11 
      @tarojs/taro-qq: 1.3.11 => 1.3.11 
      @tarojs/taro-quickapp: 1.3.11 => 1.3.11 
      @tarojs/taro-redux-rn: ^1.3.11 => 1.3.12 
      @tarojs/taro-rn: ^1.3.11 => 1.3.12 
      @tarojs/taro-router-rn: ^1.3.11 => 1.3.12 
      @tarojs/taro-swan: 1.3.11 => 1.3.11 
      @tarojs/taro-tt: 1.3.11 => 1.3.11 
      @tarojs/taro-weapp: 1.3.11 => 1.3.11 
      @tarojs/webpack-runner: 1.3.11 => 1.3.11 
      eslint-config-taro: 1.3.11 => 1.3.11 
      eslint-plugin-taro: 1.3.11 => 1.3.11 
      nerv-devtools: ^1.4.0 => 1.4.3 
      nervjs: ^1.4.0 => 1.4.3 
      react: 16.3.1 => 16.3.1 
      react-native: 0.55.4 => 0.55.4 
      stylelint-config-taro-rn: 1.3.11 => 1.3.11 
      stylelint-taro-rn: 1.3.11 => 1.3.11 
@taro-bot
Copy link

taro-bot bot commented Aug 6, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@taro-bot
Copy link

taro-bot bot commented Aug 6, 2019

CC @Pines-Cheng

@Pines-Cheng
Copy link
Contributor

感谢反馈。

@flingInTheSky
Copy link
Author

什么时候有解决方案呢

@Pines-Cheng
Copy link
Contributor

已重现,正在 fix 。

@Pines-Cheng
Copy link
Contributor

@flingInTheSky 或者你把项目里文件的 jsx 后缀改为 js 后缀也可以解决这个报错。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants