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

NodeJS (TypeScript) source files don't seem to be uploaded when --upload-sources is set #76

Closed
1 of 3 tasks
logicbomb421 opened this issue Aug 5, 2021 · 1 comment
Closed
1 of 3 tasks

Comments

@logicbomb421
Copy link

Describe the bug

We have a TypeScript project with a relatively common layout where our source files live in src, and during build, get transpiled into lib. The transpilation generates a .js and .js.map file for each .ts file it finds, as expected. The map files do include the path to the source file.

When uploading the source maps for a release with the --upload-sources flag set, the actual .ts sources do not seem to be uploaded to BugSnag. This is further confirmed by all error stacks showing the .js file instead of .ts.

Steps to reproduce

We are running the following command from the root of our project (src and lib folders exist side-by-side):

bugsnag-sourcemaps upload \
  --api-key=${BUGSNAG_API_KEY} \
  --app-version=${VERSION} \
  --directory \
  --upload-sources \
  --overwrite

The logs that we see during this show all the .js.map files being uploaded, but no .ts files:

[info] Found 109 source map(s) to upload  
...
[info] Uploading (api-error-handler.js.map)                                                                                                                                                                                      
[info] Upload successful (passport-platform.js.map)                                                                                                                                                                              
[info] Uploading (index.js.map)                                                                                                                                                                                                  
[info] Upload successful (index.js.map)                                                                                                                                                                                          
[info] Uploading (ui-error-handler.js.map)                                                                                                                                                                                       
[info] Upload successful (utils.js.map)                                                                                                                                                                                          
[info] Uploading (utils.js.map)                                                                                                                                                                                                  
[info] Upload successful (api-error-handler.js.map)                                                                                                                                                                              
[info] Uploading (index.js.map)                                                                                                                                                                                                  
[info] Upload successful (type-parsing.js.map)                                                                                                                                                                                   
[info] Uploading (request-id.js.map)         
...

Interestingly, the source maps listing for the project in the Bugsnag UI shows the .js files, but does not appear to show the .js.map files.

I have confirmed the map files link to the corresponding .ts files by examining one and finding "sources":["../../../src/controllers/monitor/bugsnag.ts"].

Environment

  • bugsnag-source-maps version:
  • Uploading for:
    • Browser
    • Node
      • Node version: v14.16.0
    • React Native
      • React Native version:
  • Command that was run: See above code block

This feels like I've missed a setting or misunderstood something in the documentation, but I can't seem to find it. Please let me know if more info is needed. Thanks for the help!

@yousif-bugsnag
Copy link
Contributor

Hi @logicbomb421, based on your reproduction steps it looks like you're using the old bugsnag-sourcemaps CLI tool, which has been deprecated in favour of @bugsnag/source-maps (the CLI tool hosted in this repo).

You can find a guide on how to upload source maps using the new CLI in our docs:
https://docs.bugsnag.com/build-integrations/js/source-maps-node/

I'm going to close this issue as it appears to relate to the old CLI, but if you are still having the same issue using @bugsnag/source-maps let us know and we'd be happy to repoen it.

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

No branches or pull requests

2 participants