Uploading source maps steps 1, unclear when using nx+angular and alternate builders.
Core or SDK?
Platform/SDK
Which part? Which one?
NX+Angular
Description
Was trying to setup sourcemap upload for an nx+angular project. (Have already integrated Sentry using the angular-ivy SDK).
The documentation here , assumes i'm using the default executor @angular-devkit/build-angular:browser .
I'm currently using the newer build system executor (>= Angular 17) @angular-devkit/build-angular:application and also intend to evaluate the esbuild executor @angular-devkit/build-angular:browser-esbuild.
Its unclear on how to setup sourcemap upload when using a different executor.
Suggested Solution
Its unclear if this is a documentation issue or a sdk support issue. (maybe both)
- Does the Sentry webpack plugin work when using @angular-devkit/build-angular:application? Are the setup instructions the same ? What about step 1 ?
- Need Instructions when using the executor @angular-devkit/build-angular:browser-esbuild
- I'm using nx, so potentially need instructions for any of the angular executors
Assigning to @getsentry/support for routing ⏲️
Routing to @getsentry/product-owners-sdks-web-frontend for triage ⏲️
Hey @giantslogik thanks for writing in and apologies for the late reply!
You're bringing up a good point! This guide was written after users asked how they could use our webpack plugin with an Nx+Angular project (https://github.com/getsentry/sentry-javascript/issues/8267). At the time of writing, I didn't consider that you're already using other Nx/Angular builders or even other bundlers.
To keep my reply short: Uploading source maps should always work if you're able to register bundler plugins. In the case of Angular (and Nx) the most logical choice was Webpack but esbuild should work just as well. I recommend following our general guides for webpack or esbuild. Ultimately, you just need a configuration in which you can register plugins to your bundler.
The reason why the specific Angular CLI and Nx Angular CLI guides exist is because default setups don't allow you to add plugins. Even in this case, there's a third option which always works: Uploading source maps via the Sentry CLI.
I'll reword step one in the Nx guide to better reflect the intention. Step 2 is basically equivalent to the general guide.
I opened https://github.com/getsentry/sentry-docs/pull/9335 to improve the guide a bit. Please feel free to take a look at the PR for preliminary instructions. If you wanna leave a review, that's much appreciated :)
@Lms24 Thanks, the improved guide did clarify things. To have the maximum flexibility to switch builders, i've gone with the sentry-cli. Are there any advantages to the bundler plugins v/s sentry-cli?
@giantslogik the bundler plugins offer a bit more out of the box functionality to manage releases, set commits, deployment information, etc. You can do all of this in the CLI, it's just more commands that you have to manually execute (or put in a script/add to your CI/etc). But to be fair, I also think the CLI is still the most flexible and least cumbersome way for sourcemaps upload in Angular apps. It's an unfortunate consequence of Angular's closed build system :(