bugsnag / webpack-bugsnag-plugins

Webpack plugins for common BugSnag actions.
MIT License
32 stars 29 forks source link

fix(source-map-uploader): Only find corresponding source if a map file was found #4

Closed bengourley closed 6 years ago

bengourley commented 6 years ago

In cases where no .map files are found for a chunk, attempting to replace the map file's name threw an error because map=null (and the code expected a string). Additionally, calling cb() when no map/file is found causes cb() to be called multiple times because this function is run for each chunk. This is fixed by returning null and then filtering out falsey values from the result of the async map.


I ran into issues around this area of then code when attempting to debug #3. These adjustments mean I am able to build a hello world nextjs app and upload the sourcemaps.