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

Using source map support removes details from some errors

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
领域
devtools

调研方向

分别在加载和不加载 source-map-support 的情况下重现 Sequelize/PostgreSQL 错误,比较完整的错误详细信息以及报告中显示的映射堆栈跟踪。跟踪会捕获或重写错误的 source-map-support 入口路径;完成的标准是:在不移除 Sequelize 和数据库错误详细信息的情况下,映射后的 trace 仍然可用,并为两种情况添加回归测试。

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

描述

I have a project using sequelize and is also written in typescript, so I use this package to show the typescript files in stack traces. However, when using this, all the important parts of sequelize's errors get removed for some reason.
Without source-map-support loaded:

node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

Error
    at Query.run (/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/dist/lib/dialects/postgres/query.js:50:25)
    at /home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/dist/lib/sequelize.js:313:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async PostgresQueryInterface.select (/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/dist/lib/dialects/abstract/query-interface.js:396:12)
    at async Function.findAll (/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/dist/lib/model.js:1119:21)
    at async MessageListener.exec (/home/tyman/Documents/YourApps_JS/dist/listeners/client/message.js:19:22) {
  name: 'SequelizeDatabaseError',
  parent: error: relation "Apps" does not exist
      at Parser.parseErrorMessage (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/parser.js:287:98)
      at Parser.handlePacket (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/parser.js:126:29)
      at Parser.parse (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/parser.js:39:38)
      at Socket.<anonymous> (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/index.js:11:42)
      at Socket.emit (node:events:390:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:199:23) {
    length: 104,
    severity: 'ERROR',
    code: '42P01',
    detail: undefined,
    hint: undefined,
    position: '190',
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'parse_relation.c',
    line: '1381',
    routine: 'parserOpenTable',
    sql: `SELECT "id", "name", "description", "guild", "questions", "rewardroles", "removeroles", "requiredroles", "customcommand", "closed", "cooldown", "minjointime", "createdAt", "updatedAt" FROM "Apps" AS "App" WHERE "App"."guild" = '916752657413181450';`,
    parameters: undefined
  },
  original: error: relation "Apps" does not exist
      at Parser.parseErrorMessage (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/parser.js:287:98)
      at Parser.handlePacket (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/parser.js:126:29)
      at Parser.parse (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/parser.js:39:38)
      at Socket.<anonymous> (/home/tyman/Documents/YourApps_JS/.yarn/cache/pg-protocol-npm-1.5.0-390f8d9ed8-b839d12caf.zip/node_modules/pg-protocol/dist/index.js:11:42)
      at Socket.emit (node:events:390:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:199:23) {
    length: 104,
    severity: 'ERROR',
    code: '42P01',
    detail: undefined,
    hint: undefined,
    position: '190',
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: undefined,
    table: undefined,
    column: undefined,
    dataType: undefined,
    constraint: undefined,
    file: 'parse_relation.c',
    line: '1381',
    routine: 'parserOpenTable',
    sql: `SELECT "id", "name", "description", "guild", "questions", "rewardroles", "removeroles", "requiredroles", "customcommand", "closed", "cooldown", "minjointime", "createdAt", "updatedAt" FROM "Apps" AS "App" WHERE "App"."guild" = '916752657413181450';`,
    parameters: undefined
  },
  sql: `SELECT "id", "name", "description", "guild", "questions", "rewardroles", "removeroles", "requiredroles", "customcommand", "closed", "cooldown", "minjointime", "createdAt", "updatedAt" FROM "Apps" AS "App" WHERE "App"."guild" = '916752657413181450';`,
  parameters: {}
}

With source-map-support loaded:

/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/lib/dialects/postgres/query.js:76
    const errForStack = new Error();
                        ^
Error: 
    at Query.run (/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/lib/dialects/postgres/query.js:76:25)
    at /home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/lib/sequelize.js:642:28
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at PostgresQueryInterface.select (/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/lib/dialects/abstract/query-interface.js:978:12)
    at Function.findAll (/home/tyman/Documents/YourApps_JS/.yarn/__virtual__/sequelize-virtual-8cc6ae77bf/0/cache/sequelize-npm-6.12.5-5a012ec055-b347e31d18.zip/node_modules/sequelize/lib/model.js:1789:21)
    at MessageListener.exec (/home/tyman/Documents/YourApps_JS/src/listeners/client/message.ts:15:16)
主要语言
JavaScript
星标
2.2k
派生
221
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

evanw/node-source-map-support 的其他 Issue

查看 evanw/node-source-map-support 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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