ufo22940268
V2EX  ›  Node.js

有碰到过 webstorm 上调试 typescript 代码的时候断点漂移的问题吗?

  •  
  •   ufo22940268 · Oct 4, 2019 · 5729 views
    This topic created in 2415 days ago, the information mentioned may be changed or developed.

    情况是我在用 jest 跑 unittest 的时候,发现打的断点是 68 行,但是实际上 hit 的时候是 90 行

    下面附上一些配置

    • tsconfig
    {
      "compilerOptions": {
        "target": "es2018",
        "lib": ["esnext"],
        "allowSyntheticDefaultImports": true,
        "module": "commonjs",
        "esModuleInterop": true,
        "moduleResolution": "node",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "allowJs": true,
        "checkJs": false,
        "sourceMap": true,
        "skipLibCheck": true,
        "noEmit": true
      }
    }
    
    • Debug Configuration

    • Webstorm version

    Supplement 1  ·  Oct 5, 2019
    找到问题的原因了,原来是换行符没有选对,选择 CR 就好了

    ![]( )
    2 replies    2019-10-05 11:04:21 +08:00
    ochatokori
        1
    ochatokori  
       Oct 4, 2019 via Android   ❤️ 1
    会不会是没有更新 build…
    我有时忘记开 watch 断点漂移才想起来
    enjoyCoding
        2
    enjoyCoding  
       Oct 5, 2019
    没更新代码吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4775 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 01:04 · PVG 09:04 · LAX 18:04 · JFK 21:04
    ♥ Do have faith in what you're doing.