Skip to content

chore: add source map to ncc transpilation#391

Open
pose wants to merge 2 commits intoaws-actions:mainfrom
pose:pose/chores/better-stack-traces
Open

chore: add source map to ncc transpilation#391
pose wants to merge 2 commits intoaws-actions:mainfrom
pose:pose/chores/better-stack-traces

Conversation

@pose
Copy link

@pose pose commented Jan 22, 2026

Issue #, if available: N/A

Description of changes: Before this change when the action failed, a very verbose message was displayed that is preventing properly debugging issues. By introducing source maps, it would be now possible to understand what's causing the error.

For instance, here is one error GitHub Action workflow error which I am not able to diagnose due to this: https://github.com/pulumi/pulumi-kubernetes/actions/runs/21197820169/job/60977392333#step:2:730

Here is a sample of how an error that I manually triggered will look like (using act):

[Comment on stale issues/Stale issue job]   ❗  ::error::failed to run action: Error: Why stack traces are so bad?
|
| /run/act/actions/aws-actions-stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440/dist/github.js:87
|     throw new Error("Why stack traces are so bad?");
| ^
| Error: Why stack traces are so bad?
|     at getTimelineEvents (/run/act/actions/aws-actions-stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440/dist/github.js:87:1)
|     at /run/act/actions/aws-actions-stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440/dist/index.js:1:3807
|     at Array.map (<anonymous>)
|     at processIssues (/run/act/actions/aws-actions-stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440/dist/index.js:1:3044)
|     at processTicksAndRejections (node:internal/process/task_queues:95:5)
|     at run (/run/act/actions/aws-actions-stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440/dist/index.js:1:7080)
[Comment on stale issues/Stale issue job]   ❌  Failure - Main aws-actions/stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440 [4.092979s]

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Before this change when the action failed, a very verbose message was
displayed that is preventing properly debugging issues. By introducing
source maps, it would be now possible to understand what's causing the
error.
package.json Outdated
"description": "GitHub Action that cleans up old and response-reqested issues",
"private": true,
"main": "dist/entrypoint.js",
"main": "dist/index.js",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated, but it should point to dist/index.js since there's no dist/entrypoint.js file. I know the GH Action still works, but took me a minute or two of scratching my head.

"test": "npm run lint && vitest run && npm run build",
"build": "tsc",
"package": "npm run build && ncc build -m --license THIRD-PARTY -o dist && node -e \"require('fs').cpSync('dist/THIRD-PARTY', './THIRD-PARTY')\"",
"package": "npm run build && ncc build -s -m --license THIRD-PARTY -o dist && node -e \"require('fs').cpSync('dist/THIRD-PARTY', './THIRD-PARTY')\"",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-s toggles source maps: https://github.com/vercel/ncc#options . Given the size of the script, I don't believe there would be any noticeable performance degradation and it would help users troubleshoot future problems.

@pose pose force-pushed the pose/chores/better-stack-traces branch from 60cee8a to 4005077 Compare January 30, 2026 17:07
@pose pose marked this pull request as ready for review February 3, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant