This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During the refactor for #40, the wrong variable name was referenced in
getSendableSource()
which meant that the--upload-sources
logic ceased to work, introducing #42.While tracking this down, I also noticed that
--upload-sources
was not compatible with relative paths in the source map.Also while tracking this down I noticed that the error information included in the API response was not surfaced to the user, so I updated the output there.
To test these fixes, using a similar setup at the OP in #42:
Make sure you have
bugsnag-sourcemaps
cloned locally (checkoutmaster
) and reference it like so:You should see the following error:
Now check out this branch (
bengourley/upload-sources-fix
) and repeat – you should see a successful upload (if you used a valid api key) or an API error (invalid API key, uploading source maps for an existing version etc.), showing that the library sent a reasonable request.or
You can also use the example TypeScript project to test out the fix for
--upload-sources
in conjunction with--directory
mode:"inlineSources": false
(or comment out that line) intsconfig.json
npm run build
– this will now build without including source content in the mapnpm run upload-source-maps
– this won't include sourcesnpm start
– sends an errornpm run upload-source-maps -- --overwrite --upload-sources
re-upload source maps but tell it to include the sourcesnpm start
– sends another errormaster
it won't)