-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
Paths passed to the Sentry CLI's --ignore argument (for the sourcemaps inject and the sourcemaps upload subcommands) are interpreted as being relative to the paths being injected/uploaded. However, the paths that the NextJS SDK passes to the bundler plugin are absolute paths (i.e. starting from the root directory), but the CLI also interprets these as being relative. For example, we can observe the incorrect paths in this log:
INFO 2025-11-04 17:26:33.690158 +01:00 sentry-cli was invoked with the following command line: "/Users/dszoke/Development/sentry-changelog-benchmark/node_modules/.pnpm/@[email protected]/node_modules/@sentry/cli-darwin/bin/sentry-cli" "--header" "<redacted>" "--header" "<redacted>" "sourcemaps" "upload" "--release" "<redacted>" "/Users/dszoke/Development/sentry-changelog-benchmark/.next/server" "--ignore" "/Users/dszoke/Development/sentry-changelog-benchmark/.next/static/chunks/framework-*" "--ignore" "/Users/dszoke/Development/sentry-changelog-benchmark/.next/static/chunks/framework.*" "--ignore" "/Users/dszoke/Development/sentry-changelog-benchmark/.next/static/chunks/polyfills-*" "--ignore" "/Users/dszoke/Development/sentry-changelog-benchmark/.next/static/chunks/webpack-*" "--rewrite"
From what I can tell, the --ignore paths get computed here, at least for NextJS. We should also check any other places where we might set ignore paths, to ensure they are computed correctly.
See also getsentry/sentry-cli#2916 (CLI-214) which initially reported the behavior in Sentry CLI.
andreiborza