FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[v20.x backport] lib: suppress source map lookup exceptions by devjiwonchoi · Pull Request #59653 · nodejs/node · GitHub

/ node Public

[v20.x backport] lib: suppress source map lookup exceptions - #59653

Closed
devjiwonchoi wants to merge 2 commits into
nodejs:v20.x-stagingfrom
devjiwonchoi:backport-56299-to-20
Closed

[v20.x backport] lib: suppress source map lookup exceptions#59653
devjiwonchoi wants to merge 2 commits into
nodejs:v20.x-stagingfrom
devjiwonchoi:backport-56299-to-20

Conversation

devjiwonchoi commented Aug 27, 2025
edited
Loading

Copy link
Copy Markdown

Backports #56299 to v20.x.

When bumping v18 to v20, I received the following error from a test fixture with an invalid source-map.

TypeError [ERR_INVALID_ARG_TYPE]: The \"payload\" argument must be of type object. Received null
  at cloneSourceMapV3 (node:internal/source_map/source_map:365:3)
  at new SourceMap (node:internal/source_map/source_map:145:21)
  at findSourceMap (node:internal/source_map/source_map_cache:352:17)
  at filterStackFrameDEV (file:///Users/devjiwonchoi/code/work/next.js/packages/
  next/dist/compiled/next-server/app-page.runtime.dev.js:23:10359)

Found PR #56299 skips parsing invalid sourcemap, which will suppress this error, was backported to v22.14.0 and v23.6.0, but was never landed on v20.x.

It received the label backport-requested-v20.x on June 5th, but has not been backported yet. Therefore, opened this backporting PR, hopefully proposing to 20.19.5 'Iron'.

cc @marco-ippolito as whom added the label 🙏

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

Copy link
Copy Markdown
Member

the [v20.x backport] should not be added in the commit message, we already include some metadata when landing

Copy link
Copy Markdown
Author

the [v20.x backport] should not be added in the commit message, we already include some metadata when landing

Got it, removed.

aduh95 commented Aug 29, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

The commit message is different from the one for 28557ef, e.g. the PR-URL is not a URL. Also a33ec12 backport is missing. Let me push a fix for you

aduh95 force-pushed the backport-56299-to-20 branch from 12bcd81 to fb18c72 Compare August 29, 2025 11:08
When the source map data are invalid json strings, skip construct
`SourceMap` on it. Additionally, suppress exceptions on source map
lookups and fix test runners crash on invalid source maps.

PR-URL: nodejs#56299
Refs: nodejs#56296
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
`array.map`.

PR-URL: nodejs#56299
Refs: nodejs#56296
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
aduh95 force-pushed the backport-56299-to-20 branch from fb18c72 to 4c0ad1e Compare August 29, 2025 11:13

Copy link
Copy Markdown
Author

The commit message is different from the one for 28557ef, e.g. the PR-URL is not a URL. Also a33ec12 backport is missing. Let me push a fix for you

I see, thanks 🙏

marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2025
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2025

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member

osx is failing for unrelated reason, I'm backporting

marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
When the source map data are invalid json strings, skip construct
`SourceMap` on it. Additionally, suppress exceptions on source map
lookups and fix test runners crash on invalid source maps.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
`array.map`.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>

Copy link
Copy Markdown
Member

Landed in 42224ac...78f1233

marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
When the source map data are invalid json strings, skip construct
`SourceMap` on it. Additionally, suppress exceptions on source map
lookups and fix test runners crash on invalid source maps.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Sep 2, 2025
Only invalidates source map lookup cache when a new source map is found.
This improves when user codes interleave with builtin functions, like
`array.map`.

PR-URL: #56299
Backport-PR-URL: #59653
Refs: #56296
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
devjiwonchoi deleted the backport-56299-to-20 branch September 23, 2025 21:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL