Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for source maps #59

Open
whilefoo opened this issue Feb 7, 2025 · 1 comment
Open

Support for source maps #59

whilefoo opened this issue Feb 7, 2025 · 1 comment

Comments

@whilefoo
Copy link
Member

whilefoo commented Feb 7, 2025

The logger output includes a stack trace with minified and bundled files, making it difficult to understand where the error occurred. Here is an example:

<!-- UbiquityOS - async - 2074e5f5-cd87-4325-a261-b26f990910d3 - @Developer-Harshit - https://dash.cloudflare.com/17b9dfa79e16b79dffcb11a66768539c/workers/services/view/ubiquity-os-command-start-stop-development/production/observability/logs?granularity=0&time=%7B%22type%22%3A%22absolute%22%2C%22to%22%3A1738774664711%2C%22from%22%3A1738774544711%7D
{
  "message": "",
  "name": "AggregateError",
  "stack": "AggregateError\n    at start (index.js:58261:11)\n    at async userStartStop (index.js:58484:12)\n    at async startStopTask (index.js:58643:14)\n    at async Array.&lt;anonymous&gt; (index.js:48626:22)"
}
-->

To improve readability and easier debugging, the logger should fetch the source map (if it's available) and transform the stack so the file names and line numbers will match to original files.
The are multiple libraries for this like source-map-support, source-map...but research needs to be done on which one is suitable for this use case

Currently, Actions plugins get bundled by ncc into a single file index.js and a source map index.js.map so that can be used, but Workers plugins get bundled by wrangler automatically so that should be disabled and it should use our ncc build.

Copy link
Contributor

Note

The following contributors may be suitable for this task:

whilefoo

77% Match ubiquity-os-marketplace/command-start-stop#136

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

No branches or pull requests

2 participants