Skip to content

TS2 import module not found #212

Closed
Closed

Description

@patrickhousley

I am getting the below errors when importing the reactotron-react-native module.

Config:

import Reactotron, { trackGlobalErrors } from 'reactotron-react-native';
import tronsauce from 'reactotron-apisauce';

if (__DEV__) {
  Reactotron
    .configure({
      // host: '10.0.3.2' // default is localhost (on android don't forget to `adb reverse tcp:9090 tcp:9090`)
      name: 'Adnega' // would you like to see your app's name?
    })

    // forward all errors to Reactotron
    .use(trackGlobalErrors({
      // ignore all error frames from react-native (for example)
      veto: (frame: any) =>
        frame.fileName.indexOf('/node_modules/react-native/') >= 0
    }))

    // register apisauce so we can install a monitor later
    .use(tronsauce())

    // let's connect!
    .connect();

  // Totally hacky, but this allows you to not both importing reactotron-react-native
  // on every file.  This is just DEV mode, so no big deal.
  console.tron = Reactotron;
} else {
  // a mock version should you decide to leave console.tron in your codebase
  console.tron = {
    log: () => false,
    warn: () => false,
    error: () => false,
    display: () => false,
    image: () => false
  };
}

Errors:

Error: Error at src/config/reactotron.config.ts:1:47: Cannot find module 'reactotron-react-native'.
Error at src/config/reactotron.config.ts:2:23: Cannot find module 'reactotron-apisauce'.

package.json:

"dependencies": {
    "apisauce": "^0.5.0",
    "format-json": "^1.0.3",
    "querystringify": "0.0.4",
    "ramda": "^0.22.1",
    "react": "~15.3.0",
    "react-native": "^0.33.0",
    "react-native-animatable": "^0.6.0",
    "react-native-config": "^0.1.0",
    "react-native-device-info": "^0.9.5",
    "react-native-drawer": "^2.3.0",
    "react-native-i18n": "^0.1.1",
    "react-native-maps": "^0.8.2",
    "react-native-router-flux": "^3.35.0",
    "react-native-vector-icons": "^2.1.0",
    "react-redux": "^4.4.2",
    "redux": "^3.6.0",
    "redux-logger": "^2.4.0",
    "redux-persist": "^3.5.0",
    "redux-saga": "^0.11.1",
    "reduxsauce": "0.2.0",
    "seamless-immutable": "^6.1.0"
  },
  "devDependencies": {
    "ava": "^0.16.0",
    "babel-eslint": "^6.1.0",
    "babel-preset-es2015": "^6.14.0",
    "concurrently": "^2.2.0",
    "enzyme": "^2.3.0",
    "ghooks": "^1.3.2",
    "mockery": "^1.7.0",
    "nyc": "^8.1.0",
    "react-addons-test-utils": "^15.3.1",
    "react-dom": "^15.3.1",
    "react-native-mock": "^0.2.6",
    "reactotron-apisauce": "^1.1.2",
    "reactotron-cli": "^1.1.4",
    "reactotron-react-native": "^1.1.4",
    "reactotron-redux": "^1.1.2",
    "snazzy": "^4.0.1",
    "tslint": "^3.15.1",
    "tslint-react": "^1.0.0",
    "typescript": "^2.0.2",
    "typings": "^1.3.3"
  }

Activity

  1. skellock commented on Sep 24, 2016

    @skellock
    Contributor

    Thats strange. I see them listed as devDependencies. Does typescript not parse devDependencies the same way?

    I've never used it so I'm a bit in the dark here.

  2. patrickhousley commented on Sep 24, 2016

    @patrickhousley
    Author

    I moved all the dev dependencies to dependencies and it did not make a difference.

  3. patrickhousley commented on Sep 24, 2016

    @patrickhousley
    Author

    I may have found some information to help in this issue.
    microsoft/TypeScript#11106

  4. skellock commented on Nov 13, 2016

    @skellock
    Contributor

    Apparently this issue is resolve on their end?

    I don't use Typescript yet myself, so I can't verify. Feel free to re-open if you think there's something I can do to be less Typescript hostile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions