-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Sentry creates rewriteFramesHelper.js during Nextjs "standalone" static generation #4684
Comments
This is the logic that concerns itself with this - sentry-javascript/packages/nextjs/src/config/webpack.ts Lines 135 to 148 in 889024a
.next/standalone .
Adding to the backlog, but PRs are welcome for anyone who wants to help out! |
This is related to #4382, or rather, solving one will solve both. Two possible approaches:
|
I can mention that we have temporarily solved this by patching (using patch-package) the node module for this library. Its not a pretty patch but seems to work. |
Hello, we also have this problem, when building the nextjs app with outputStandalone: true on our Jenkins, we get the following error message:
Of course this path is protected on our Jenkins. When debugging locally, I found out that Sentry writes a JS file to the tmp dir:
|
Yup, that is indeed what we do. Interesting that it's protected... I would have said the whole point of a temp folder was for processes to be able to throw whatever temporary files they need to in there without having to worry about cleaning them up, and protecting it completely defeats that purpose. Regardless, in the long run, I think it's reasonable to change our approach, using one of the two strategies I outlined above. In the short run, would any of the strategies listed here solve your problem? |
I met the same problem. |
Hey @calix can you share your patch, however ugly? |
That error disappear when I build in Linux. It occurs when only windows OS |
I meet the same problem, during build sentry want create new folder but with weird path |
Setting the |
Sorry - This should have been marked as fixed in #5445, which was first included in version 7.8.0. I'm going to close this, but please let me know if it's still happening for you in a later version. |
Is there an existing issue for this?
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.
The text was updated successfully, but these errors were encountered: