【问题标题】:Resolve Source map for proto-loader in VS Code解决 VS Code 中 proto-loader 的源映射
【发布时间】:2021-04-30 12:29:27
【问题描述】:

当我运行 node.js 程序时,我收到以下错误:

Could not read source map for file:.../node_modules/@grpc/proto-loader/build/src/index.js
ENOENT: no such file or directory, open '.../node_modules/@grpc/proto-loader/build/src/index.js.map

inex.js 文件确实存在,但是没有 index.js.map 文件。

我的 launch.json 看起来像这样:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}/app.js",
            "runtimeArgs": [
                "--preserve-symlinks",
                "--preserve-symlinks-main"
            ],
        },
    ],
    "resolveSourceMapLocations": [
        "${workspaceFolder}/**",
        "!**/node_modules/**"
      ],
}

如何解决此源映射?或者我可以要求vs code跳过index.js.map吗?

【问题讨论】:

    标签: node.js grpc proto


    【解决方案1】:

    在 launch.json 中将 "type": "node" 更改为 "type": "pwa-node"

    【讨论】:

      猜你喜欢
      • 2017-06-23
      • 2019-09-29
      • 2019-06-06
      • 2017-04-08
      • 2018-11-01
      • 2020-06-30
      • 1970-01-01
      • 2019-12-20
      • 1970-01-01
      相关资源
      最近更新 更多