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

启动报错 #510

Closed
DexSinis opened this issue Nov 11, 2016 · 4 comments
Closed

启动报错 #510

DexSinis opened this issue Nov 11, 2016 · 4 comments

Comments

@DexSinis
Copy link

xcode7.3.1 node6.5.0

你做了什么?

按照官方教程 git clone 工程之后 执行 npm install之后 在xcode中 启动工程,报错

Unable to resolve module ../components/notice-bar/demo/basic from /Users/a000/Documents/React/ant-design-mobile/rn-kitchen-sink/demoList.js: Unable to find this module in its module map or any of the node_modules directories under /Users/a000/Documents/React/ant-design-mobile/components/notice-bar/demo/basic and its parent directories

This might be related to facebook/react-native#4968
To resolve try the following:

  1. Clear watchman watches: watchman watch-del-all.
  2. Delete the node_modules folder: rm -rf node_modules && npm install.
  3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache.

RCTFatal + 124
-[RCTBatchedBridge stopLoadingWithError:] + 1140
__25-[RCTBatchedBridge start]_block_invoke_2 + 76
_dispatch_call_block_and_release + 24
_dispatch_client_callout + 16
_dispatch_main_queue_callback_4CF + 2096
+ 12
+ 1628
CFRunLoopRunSpecific + 384
GSEventRunModal + 180
UIApplicationMain + 204
main + 124
+ 4

你期待的结果是:

像官网一样正常显示

实际上的结果:

报错

可重现的在线演示

@silentcloud
Copy link
Contributor

silentcloud commented Nov 11, 2016

@DexSinis tsx 文件没有生成对应的 js 文件,可以直接在 命令行运行 npm run ios

或者先运行 npm run watch-tsc,然后再在 xcode 里 run

@DexSinis
Copy link
Author

解决了,但是我在我原来的工程里面引入 ant-design-mobile

{
"name": "BAdvisory",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"antd-mobile": "^0.9.6",
"react": "15.3.2",
"react-native": "0.36.1"
},
"jest": {
"preset": "jest-react-native"
},
"devDependencies": {
"babel-jest": "16.0.0",
"babel-preset-react-native": "1.9.0",
"jest": "16.0.2",
"jest-react-native": "16.0.0",
"react-test-renderer": "15.3.2",
"react-native-tab-navigator": "^0.3.3",
"react-native-root-toast": "^1.0.3",
"react-native-device-info": "^0.9.5"
}
}

npm install 后 引入你们官方tabbar例子 https://mobile.ant.design/components/tab-bar/

import React,{Component} from 'react'
import {
View,
Text,
StyleSheet,
AppRegistry,
TouchableHighlight,
Navigator,
TouchableOpacity,
Image,
}from 'react-native'

import { TabBar } from 'antd-mobile';

报错
Unable to resolve module antd-mobile from /Users/a000/Documents/React/BAdvisory/BAdvisory.js: Module does not exist in the module map or in these directories:
/Users/a000/Documents/React/BAdvisory/node_modules

This might be related to facebook/react-native#4968

@DexSinis
Copy link
Author

import { TextareaItem } from 'antd-mobile' 异常 #49 #56
语法要这样写
import Button from 'antd-mobile/lib/button';

@lock
Copy link

lock bot commented May 28, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants