-
Notifications
You must be signed in to change notification settings - Fork 24
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 artifact bundles (release-based sourcemap uploading is deprecated) #170
Comments
All dependencies are now at 7.60.0 https://github.com/robertcepa/toucan-js/releases/tag/toucan-js%403.2.0 I'll look at Artifact Bundles sometimes next week, but any feedback/suggestions are welcome! |
I’ve got it working with artifact bundles on the server: import { $, argv } from "zx";
// Cut a Sentry release
const version = await $`pnpm sentry-cli releases propose-version`;
await $`sentry-cli releases new ${version}`;
// Inject & upload source maps for the server code
await $`pnpm sentry-cli sourcemaps inject ./dist/server`;
await $`pnpm sentry-cli sourcemaps upload --dist server --release ${version} ./dist/server`;
// Update the commit tracking on production
await $`pnpm sentry-cli releases set-commits ${version} --auto`;
await $`sentry-cli releases finalize ${version}`;
// Deploy to Cloudflare
// We need to add `--no-bundle` to prevent Wrangler from putting the build through ESBuild again, which will mess up the source mappings
await $`pnpm wrangler deploy --no-bundle --var SENTRY_VERSION:${version}`;
// Deploy the project in the current environment
await $`pnpm sentry-cli releases deploys ${version} new`; Essentially, everything works like it used to, but you have to migrate a few of the commands to the new The one caveat is the trade-off between passing |
Thanks for sharing, @huw. Here's what I've been doing via GitHub Actions (see YAML snippet below). My trick has been to use In your approach, how are you actually building your worker project? - name: Generate server source maps
run: npm run --workspace server deploy-production -- --dry-run --outdir=dist
- name: Create Sentry release for this commit
run: npx sentry-cli releases new "$SENTRY_RELEASE"
- name: Upload client source maps to Sentry
run: npx sentry-cli releases files "$SENTRY_RELEASE" upload-sourcemaps --dist client ./client/dist
- name: Upload server source maps to Sentry
run: npx sentry-cli releases files "$SENTRY_RELEASE" upload-sourcemaps --dist server ./server/dist
- name: Set commits for Sentry release
run: npx sentry-cli releases set-commits "$SENTRY_RELEASE" --commit "${{ github.repository }}@${{ github.event.before }}..${{ github.sha }}"
- name: Finalize sentry release
run: npx sentry-cli releases finalize "$SENTRY_RELEASE" |
You should be able to tell because your output files will have a Some more colour on my build process—I’m using a Remix site which is bundling the server files as part of its own build process. I can rebundle those with Wrangler and upload the output source maps, but those source maps have been getting my line numbers slightly wrong (usually off by one or two lines). I think it might be to do with the I assume for a normal project, at least one that doesn’t use a custom build, you should be able to upload Wrangler’s source maps after injecting them with debug IDs. |
@huw did you manage to figure out why It was off by 1 or 2 lines? I am having the same issue in both cases: |
@huw why 👎 ? can you elaborate please? |
As I said, never got the time to investigate properly |
It seems that Sentry has deprecated the release-based sourcemap uploading system used by toucan-js, and instead switched to a new system called "artifact bundles".
Unfortunately, it seems that toucan doesn't support this system yet.
At minimum (but I believe there is more to do as well), it looks like we need to use sentry version
7.47.0
— this library is currently using7.43.0
.Is this something you plan to support?
The text was updated successfully, but these errors were encountered: