#Next.js on Cloudflare Pages and Sourcemaps

6 messages · Page 1 of 1 (latest)

smoky current
#

does this wrangler runs before or after webpack, from your description it sounds like it runs after it.
in this case, the sentry webpack plugin used in nextjs will not be able to upload the files.
you can manually upload them with the sentry-cli: https://docs.sentry.io/product/cli/releases/#sentry-cli-sourcemaps

Sentry's command line interface can be used for release management. The CLI allows you to create, edit and delete releases as well as upload release artifacts.

#

as for source maps, "we only apply sourcemaps once". So the if you manage to get the source maps from wrangler to work, they need to point directly to your original code.

#

like, if if points to your compiled code, and this compiled code is minified, we will try to find the source maps a second time to find the original source code

smoky current
#

you can set the same release in the upload command and it will work fine

#

just need to pay attention the file names are not the same

#

by default the release name is the last commit SHA, you can set it to environmnet varibales, or last case scenarion, fetch the name from sentry with our API