1

I have problem with debugging of my ReactNative app written in TypeScript when I use WebStorm IDE.

Application works, but when I put breakpoint to render method code never stopped on it.

Here is my tsconfig:

  {
    "compilerOptions": {
      "module": "commonjs",
      "target": "es5",
      "sourceMap": true,
      "moduleResolution": "node",
      "jsx": "react-native",
      "outDir": "artifacts",
      "rootDir": "src",
      "noImplicitAny": false,
      "preserveConstEnums": true,
      "allowJs": false,
      "sourceMap": true,
      "noImplicitReturns": true,
      "noUnusedParameters": true,
      "noUnusedLocals": true
    },
    "filesGlob": [
      "typings/index.d.ts",
      "src/**/*.ts",
      "src/**/*.tsx"
    ],
    "types": [
      "react",
      "react-native",
      "jest"
    ],
    "exclude": [
      "android",
      "ios",
      "build",
      "node_modules"
    ]
  }

and package.json:

  {
    "name": "untitled2",
    "version": "0.0.1",
    "private": true,
    "scripts": {
      "tsc": "tsc",
      "start": "node node_modules/react-native/local-cli/cli.js start",
      "build": "npm run clean && npm run tsc --",
      "test": "jest"
    },
    "dependencies": {
      "react": "16.3.1",
      "react-native": "0.55.3",
      "inversify": "^4.13.0",
      "react-navigation": "^1.5.11"
    },
    "devDependencies": {
      "typescript": "^2.8.3",
      "tslint": "^5.9.1",
      "@types/react": "^16.3.12",
      "babel-jest": "22.4.3",
      "babel-preset-react-native": "4.0.0",
      "jest": "22.4.3",
      "react-test-renderer": "16.3.1"
    },
    "jest": {
      "preset": "react-native",
      "testRegex": "artifacts/.+\\.(test|spec).js$",
      "coverageDirectory": "coverage",
      "coverageReporters": [
        "text-summary",
        "html"
      ]
    },
    "collectCoverageFrom": [
      "artifacts/**/*.js",
      "!artifacts/**/*.spec.js",
      "!artifacts/**/*.index.js"
    ]
  }
2
  • I use "debug symbol" to run application and it's default iOS react native configuration from Jetbrains. I add package.json configuration to my first question. Commented Apr 27, 2018 at 18:44
  • haven't found any official tutorials on this, but seems you still need using react-native-sm-transformer to add sourcemaps to the bundle. This package is a part of typescript template available for react-native init... see also shellmonger.com/2017/08/09/… Commented Apr 28, 2018 at 10:51

1 Answer 1

1

js.debugger.break.on.first.statement.with.regexp in Registry ( Help | Find Action... | Registry) helps me.

More info: https://youtrack.jetbrains.com/issue/WEB-32588

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.