Skip to content

fix(build): do not run Sentry release upload as a root postbuild hook #1444

Description

@abhinavkr26104

Summary

The root build command automatically runs a Sentry release creation and sourcemap upload after turbo run build.

This makes normal local and CI builds depend on Sentry credentials and attempts to upload a root-level dist directory that the Turbo build does not produce.

Current behavior

package.json:

{
  "scripts": {
    "build": "turbo run build",
    "sentry:sourcemaps": "_SENTRY_RELEASE=$(sentry-cli releases propose-version) && sentry-cli releases new $_SENTRY_RELEASE --org=supermemory --project=consumer-app && sentry-cli sourcemaps upload --org=supermemory --project=consumer-app --release=$_SENTRY_RELEASE --strip-prefix 'dist/..' dist",
    "postbuild": "bun run sentry:sourcemaps"
  }
}

Running:

bun run build

first completes the Turbo build, then invokes sentry:sourcemaps.

Problem

  • Local builds fail unless Sentry authentication/configuration is available.
  • CI build validation also requires deployment-only credentials.
  • The upload script targets dist, while application builds such as Next.js produce .next output.
  • The Sentry command uses POSIX shell syntax, which may not be portable to Windows environments.

Expected behavior

bun run build should only build and validate the repository. Sentry releases and sourcemap uploads should run only in an explicit deployment/release workflow, with the correct application output path.

Proposed fix

  • Remove the root postbuild hook.
  • Keep Sentry upload as an explicit command, e.g. bun run sentry:sourcemaps.
  • Invoke that command only from the production deployment pipeline after the relevant app build.
  • Update the sourcemap path and --strip-prefix to match the deployed app’s actual build output.
  • Prefer a cross-platform environment-variable approach or run the release step in the CI shell that owns deployment.

Acceptance criteria

  • bun run build succeeds without SENTRY_AUTH_TOKEN or other Sentry configuration.
  • No Sentry release/upload is attempted during ordinary builds.
  • Production deployment still creates the intended Sentry release and uploads valid sourcemaps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions