akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.28k stars 951 forks source link

RKTheme bug with RKBadge #365

Closed Deboracgs closed 5 years ago

Deboracgs commented 5 years ago

Hello,

I not using RKBadge, but when import and use RKTheme, i giving the same error

Error: Unable to resolve module `./src/components/badge/rkBadge.component` from `D:\proj\app\prop10-client-app\ClubeTarget\node_modules\react-native-ui-kitten\index.js`: The module `./src/components/badge/rkBadge.component` could not be found from `D:\proj\app\prop10-client-app\ClubeTarget\node_modules\react-native-ui-kitten\index.js`. Indeed, none of these
files exist:

my package.json


{
  "name": "ClubeTarget",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.5",
    "react-native-gesture-handler": "^1.1.0",
    "react-native-ui-kitten": "^3.1.2",
    "react-navigation": "^3.8.1"
  },
  "devDependencies": {
    "@babel/core": "7.4.3",
    "@babel/plugin-proposal-export-namespace-from": "^7.2.0",
    "@babel/runtime": "7.4.3",
    "babel-jest": "24.7.1",
    "jest": "24.7.1",
    "metro-react-native-babel-preset": "0.53.1",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  }
}
parasdaryanani commented 5 years ago

Had the exact same issue. Couldn't get v3.1.2 to work because of #357 and #358 so decided to downgrade back to 3.1.2, and then I had this same error you're seeing.

For me, running the following command worked: npm start -- --reset-cache

artyorsh commented 5 years ago

Hi @parasdaryanani @Deboracgs Thanks for report. Can you please provide related code?

zaicevas commented 5 years ago

expo r -c solved this issue for me

parasdaryanani commented 5 years ago

@artyorsh, here's my (shortened) code as requested:

import React from "react"
import { Image, Keyboard } from "react-native"
import { RkButton, RkText, RkTextInput, RkAvoidKeyboard } from 'react-native-ui-kitten'

class HomeScreen extends React.Component {
    render() {
      return (
        <RkAvoidKeyboard
            onStartShouldSetResponder={() => true}
            onResponderRelease={() => Keyboard.dismiss()}
            style={{ flex: 1, alignItems: "center", justifyContent: "center", margin: 10 }}>

            <RkTextInput
                rkType='rounded' 
                placeholder='Email'
                autoCapitalize='none'
                label={
                    <Icon
                        name='user'
                        color='#ccc'
                        style={{marginLeft: 10}}
                    />
                }
                onChangeText={(email) => this.setState({email})}
                value={this.state.email}
            />
            <RkTextInput
                rkType='rounded' 
                placeholder='Password'
                autoCapitalize='none'
                secureTextEntry={true}
                label={
                    <Icon
                        name='lock1'
                        color='#ccc'
                        style={{marginLeft: 10}}
                    />
                }
                onChangeText={(password) => this.setState({password})}
                value={this.state.password}
            />
            <RkButton
                style={{marginTop: 30}}
                rkType="primary rounded large stretch"
                onPress={() => this.props.loginAxios(this.state.email, this.state.password)}
            >
                Login
            </RkButton>
            <RkButton
                style={{marginTop: 10}}
                rkType="clear rounded large stretch"
                onPress={() => this.getData()}
            >
                <RkText>Reset Password</RkText>
            </RkButton>

        </RkAvoidKeyboard>
      );
    }
  }