Skip to content

Conversation

devjiwonchoi
Copy link

@devjiwonchoi devjiwonchoi commented Aug 27, 2025

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 🙏

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 <[email protected]>
Reviewed-By: Xuguang Mei <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch. labels Aug 27, 2025
@devjiwonchoi devjiwonchoi marked this pull request as ready for review August 27, 2025 20:09
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. v20.x Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants