Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
@sentry/nextjs
SDK Version
6.18.1
Framework Version
No response
Link to Sentry event
No response
Steps to Reproduce
We are switching to generating a standalone bundle for our Nextjs project according to: https://nextjs.org/docs/advanced-features/output-file-tracing
This issue is possible to reproduce when bundling NextJS using:
module.exports = { experimental: { outputStandalone: true, }, }
next.config.js consumes the config using withSentryConfig as described in the docs:
module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions);
We first detected the issue when our Azure pipeline failed at:
> Build error occurred [Error: ENOENT: no such file or directory, mkdir 'D:\a\1\s\.next\standalone\.next\server\pages\C:\Users\VSSADM~1\AppData\Local\Temp\sentry-Yr02pe'] { errno: -4058, code: 'ENOENT', syscall: 'mkdir', path: 'D:\\a\\1\\s\\.next\\standalone\\.next\\server\\pages\\C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\sentry-Yr02pe' } ##[error]Cmd.exe exited with code '1'.
Sentry is for some reason trying to generate a folder for the file rewritesFramesHelper.js during nextjs "Generating static pages".
When running locally, this directory is created in the root NextJS folder.
Expected Result
Expect sentry not to spam the project folder with directory sentry-xxxxx.
Actual Result
As you can see, Sentry is creating a folder Users...../sentry-xxxxxx containing rewritesFramesHelper.js.