我正在使用最新版本的Expo。我创建了一个项目expo init my_project
并添加了React Native 图表套件 https://github.com/indiespirit/react-native-chart-kit。
这是package.json:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^35.0.0",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-chart-kit": "^3.6.1",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"babel-preset-expo": "^7.0.0"
},
"private": true
}
当我导入以下内容时,它给出错误:“开发服务器返回响应错误代码:500”:
import {
LineChart,
BarChart,
PieChart,
ProgressChart,
ContributionGraph,
StackedBarChart
} from "react-native-chart-kit";
即使可以通过 Expo 访问该模块(如本[页][2]中所述),为什么会发生此错误?
[2]: https://forums.expo.io/t/any-graph-library/1674/7 https://forums.expo.io/t/any-graph-library/1674/7