Нарушение инварианта: просмотр конфигурации не найден для имени пути. Ошибка связана с победой - PullRequest
0 голосов
/ 27 марта 2020

У меня есть реактивный проект, после того, как я установил пакет victory-native с зависимостями (act-native-svg), я получил эту ошибку:

[Изображение с ошибкой, полученной на эмуляторе ] [1]

мой пакет. json:

    {
          "name": "ProjectName",
          "version": "0.0.1",
          "private": true,
          "scripts": {
            "android": "react-native run-android",
            "ios": "react-native run-ios",
            "start": "react-native start",
            "test": "jest",
            "lint": "eslint ."
          },
          "dependencies": {
            "@react-native-community/masked-view": "^0.1.7",
            "native-base": "^2.13.12",
            "react": "16.9.0",
            "react-native": "0.61.5",
            "react-native-gesture-handler": "^1.6.0",
            "react-native-safe-area-context": "^0.7.3",
            "react-native-screens": "^2.0.0-alpha.34",
            "react-native-svg": "^12.0.3",
            "react-native-vector-icons": "^6.6.0",
            "react-navigation": "^4.3.1",
            "react-navigation-drawer": "^2.4.7",
            "react-navigation-stack": "^2.3.1",
            "realm": "^5.0.0",
            "victory-native": "^34.1.0"
          },
          "devDependencies": {
            "@babel/core": "7.8.7",
            "@babel/runtime": "7.8.7",
            "@react-native-community/eslint-config": "0.0.5",
            "babel-jest": "24.9.0",
            "eslint": "6.8.0",
            "jest": "24.9.0",
            "metro-react-native-babel-preset": "0.56.4",
            "react-test-renderer": "16.9.0"
          },
          "jest": {
            "preset": "react-native"
          }
        }


  [1]: https://i.stack.imgur.com/cfsFZ.png

Here is my **HomeScreen.js** with a simplified code. The code is written mainly with the native-base components:

    import React, { Component } from 'react'
    import { Container, Button, Text, Header, Icon, Left, Right, Body, View, Title,  Drawer, List, ListItem } from 'native-base';
    import { VictoryPie } from 'victory-native';

    export default class HomeScreen extends Component {
        constructor(props) {
            super(props)
            this.state = {};
            this.getResponse = this.getResponse.bind(this);
        }

        async getResponse() {
            await fetch('http://localhost:3000/')
                .then((response) => response.json())
                .then(responseJson => {
                    console.log("HERE IS THE RESPONSE ", responseJson)
                })
        }

        render() {
            const SampleData = [
                { element1: 1, value: 13000 },
                { element2: 2, value: 16500 },
                { element3: 3, value: 14250 },
                { element4: 4, value: 19000 }
            ];

            let pie = <VictoryPie
                data={SampleData}
            />

            let pageContent = <Container>
                {pie}
            </Container>
            return (
                <Container>
                    <Header>
                        <Left>
                            <Button transparent
                                onPress={() => this.drawer._root.open()}>
                                <Icon name='menu' />
                            </Button>
                        </Left>
                        <Body>
                            <Title>App Title</Title>
                        </Body>
                        <Right>
                            <View></View>
                        </Right>
                    </Header>

                    <Drawer
                        ref={(ref) => { this.drawer = ref }}
                        content={
                            <Container>
                                <List>
                                    <ListItem><Text>Some</Text></ListItem>
                                    <ListItem><Text>Some</Text></ListItem>
                                    <ListItem><Text>Some</Text></ListItem>
                                    <ListItem><Text>Some</Text></ListItem>
                                    <ListItem><Text>Some</Text></ListItem>
                                </List>
                            </Container>
                        }
                        onClose={() => this.drawer._root.close()}
                    >
                        {pageContent}
                    </Drawer>
                </Container>
            );
        }
    };

Что я пробовал:

  1. Перезагрузка кеш

    • удалить папку node_modules
    • выполнить npm -установить
    • выполнить npm запустить - - -reset-cache
  2. Очистка кеша

    • выполнение npm очистка кэша --force
    • выполнить npm очистка кэша --force
  3. Установить вручную response-native-svg

  4. Я даже пытался использовать более старую версию реактив-native-svg
    • "реактив-native-svg ":" 11.0.1 "
  5. Я удалил приложение на эмуляторе и переустановил его.
* 106 2 * PS:

Я не тестировал ios, только android.

Я выполнил команду "Reaction-native Link Reaction-native-svg"

...