Skip to content

feat(swc): add suppressSourceMapErrorLogging flag#11707

Draft
kdy1 wants to merge 1 commit intomainfrom
kdy1/issue-9416-suppress-sourcemap-error-logging
Draft

feat(swc): add suppressSourceMapErrorLogging flag#11707
kdy1 wants to merge 1 commit intomainfrom
kdy1/issue-9416-suppress-sourcemap-error-logging

Conversation

@kdy1
Copy link
Copy Markdown
Member

@kdy1 kdy1 commented Mar 19, 2026

Summary

  • add suppressSourceMapErrorLogging?: boolean to public config types (@swc/types, wasm TS config types)
  • wire the option through Rust config path (Config -> BuiltInput -> get_orig_src_map)
  • keep default behavior unchanged (false), and only suppress logs when explicitly enabled
  • gate only input sourcemap loading logs (warn!/tracing::error!) without changing transform success/failure behavior

Tests

  • added config parsing coverage for .swcrc with suppressSourceMapErrorLogging
  • added sourcemap logging test to verify:
    • logs are emitted by default
    • logs are suppressed when suppressSourceMapErrorLogging: true
  • ran:
    • git submodule update --init --recursive
    • cargo fmt --all
    • cargo clippy --all --all-targets -- -D warnings
    • cargo test -p swc --lib issue_9416
    • cargo test -p swc --test source_map issue_9416_suppress_source_map_error_logging

Notes

  • cargo test -p swc fails in this environment for existing source map tests due missing node module sourcemap-validator
  • wasm binding scripts currently fail in this environment with npm ENOVERSIONS for rstest

Fixes #9416

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 19, 2026

⚠️ No Changeset found

Latest commit: 55ca15b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Binary Sizes

File Size
swc.linux-x64-gnu.node 28M (29066952 bytes)

Commit: 4f1e61b

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 19, 2026

Merging this PR will not alter performance

✅ 219 untouched benchmarks


Comparing kdy1/issue-9416-suppress-sourcemap-error-logging (55ca15b) with main (0ea9950)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

failed to read input source map - @swc/jest + yarn PnP workspaces

1 participant