React Native ReferenceError: Can’t find variable: i (Trouble finding where this error is occuring)

  android, javascript, react-native, react-redux

To start, these are the errors when trying to start the app:

[Wed Apr 21 2021 19:30:19.489]  WARN     Require cycle: srccomponentTagDetail.js -> srccomponentFeedList.js -> srccomponentFeedCell.js -> srccomponentTagDetail.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
[Wed Apr 21 2021 19:30:19.491]  ERROR    ReferenceError: Can't find variable: i
[Wed Apr 21 2021 19:30:19.492]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Wed Apr 21 2021 19:30:19.492]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

The problem is, I have no clue where "i" is. It’s a rather large project and I’ve done quite a bit of searching but cannot find where I’ve mislabeled a variable, or added it in accidentally as a typo. And even if I did find this one error, I’m not sure if it’d fix the other invariant violations. (The cache reset and node_module reinstallations haven’t worked for me)

Does anyone have any ideas on how I can find/fix this "i" error, and whats causing the second one? I’ll be happy to edit this to provide any code or other information as requested.

Below is the index.js where I use AppRegistry. I haven’t touched this file a while (its worked in the past), so I don’t think this is the problem

import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { AppRegistry} from 'react-native';
import { createStackNavigator} from "react-navigation-stack";
//import { StackNavigator } from 'react-navigation';
import { createAppContainer } from 'react-navigation';
import App from './src/App';
import configureStore from './src/store/index';
import TagDetail from './src/component/TagDetail';
import FeedDetail from './src/component/FeedDetail';
import UserDetail from './src/component/UserDetail';
import SettingsPage from './src/SettingsPage';
import About from './src/About';


import {name as appName} from './app.json';

const store = configureStore();


const AppNavigator = createStackNavigator({
  Home: {
    screen: App
  },
  TagDetail: {
    screen: TagDetail
  },
  FeedDetail: {
    screen: FeedDetail
  },
  UserDetail: {
    screen: UserDetail
  },
  SettingsPage: {
    screen: SettingsPage
  },
  AboutPage: {
    screen:About
  }
},{
  headerMode: 'none'
});


export default class Root extends Component {
  render() {
    return (
      <Provider store={store}>
        {/* <Main /> */}
        {/* <AppNavigator /> */}
        <Apps/>
      </Provider>
    )
  }
}


AppRegistry.registerComponent(appName, () => Root);

const Apps = createAppContainer(AppNavigator);
//export default Apps;

Source: Ask Javascript Questions

LEAVE A COMMENT