Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Not working with pnpm

未关闭
#151 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript, webpack
领域
cli, tooling

调研方向

先从链接的复现步骤和 src/lib/actions/versions.ts 第 362-368 行附近的代码开始,然后跟踪 src/lib/util/dependencies.ts 第 145-209 行中的路径处理。将逻辑上的 filePath 与 modsToFilePath 中的 realpath 键进行比较,并使用 pnpm 复现空 map。当复现不再报告空的 Found map 或缺失的 sources 时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

high priority unverified

Reproduction: https://github.com/vjpr/repro-inspectpack-pnpm-test


Possibly related: https://github.com/FormidableLabs/inspectpack/issues/131


Upon compiling I get the following error.

Compiled with warnings.

Missing sources: Expected 4, found 0.
Found map: {}

Notice how Found map: {}.

I've tracked down what is causing the map to be empty to here:

https://github.com/FormidableLabs/inspectpack/blob/917c7c9ba5118ae19b5992ed0afd505dbf6ba460/src/lib/actions/versions.ts#L362-L368

filePath = /Users/Vaughan/dev/inspectpack-pnpm-test/packages/cra/node_modules/react-refresh
modsToFilePath = {
  "/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/react-refresh": [
    {
      "baseName": "react-refresh/cjs/react-refresh-runtime.development.js",
      "chunks": [
        0
      ],
      "identifier": "/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]_427212bc1158d185e577033f19ca0757/node_modules/babel-loader/lib/index.js??ref--5-oneOf-3!/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/react-refresh/cjs/react-refresh-runtime.development.js",
      "isNodeModules": true,
      "isSynthetic": false,
      "size": 23198,
    },
    {
      "baseName": "react-refresh/runtime.js",
      "chunks": [
        0
      ],
      "identifier": "/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]_427212bc1158d185e577033f19ca0757/node_modules/babel-loader/lib/index.js??ref--5-oneOf-3!/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/react-refresh/runtime.js",
      "isNodeModules": true,
      "isSynthetic": false,
      "size": 221,
      "source": "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n  module.exports = require('./cjs/react-refresh-runtime.production.min.js');\n} else {\n  module.exports = require('./cjs/react-refresh-runtime.development.js');\n}"
    }
  ],
  "/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/react-refresh": [
    {
      "baseName": "react-refresh/cjs/react-refresh-runtime.development.js",
      "chunks": [
        0
      ],
      "identifier": "/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]_427212bc1158d185e577033f19ca0757/node_modules/babel-loader/lib/index.js??ref--5-oneOf-3!/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/react-refresh/cjs/react-refresh-runtime.development.js",
      "isNodeModules": true,
      "isSynthetic": false,
      "size": 23096,
    },
    {
      "baseName": "react-refresh/runtime.js",
      "chunks": [
        0
      ],
      "identifier": "/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]_427212bc1158d185e577033f19ca0757/node_modules/babel-loader/lib/index.js??ref--5-oneOf-3!/Users/Vaughan/dev/inspectpack-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/react-refresh/runtime.js",
      "isNodeModules": true,
      "isSynthetic": false,
      "size": 221,
    }
  ]
}

Notice how modsToFilePath's keys are the "realpath" of the package, whereas filePath is the "logical path".

filePath seems to comes from here:

https://github.com/FormidableLabs/inspectpack/blob/917c7c9ba5118ae19b5992ed0afd505dbf6ba460/src/lib/util/dependencies.ts#L145-L209

However I have reached the point where I don't understand what is going on and maybe a maintainer could quickly point to the right fix?

主要语言
TypeScript
星标
590
派生
20
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

FormidableLabs/inspectpack 的其他 Issue

查看 FormidableLabs/inspectpack 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。