Find approach that doesn't write to disk in Next.js SDK `proxyLoader`
See original GitHub issueDiscussed in https://github.com/getsentry/sentry-javascript/discussions/5943
<div type='discussions-op-text'>Originally posted by eggplants October 13, 2022
proxyLoader
creates src/pages/temp***.js
. It causes the following error in my nextjs project on Docker:
ModuleBuildError: Module build failed (from ./node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js):
Error: EROFS: read-only file system, open '/app/src/pages/temp0.5575603336148998.js'
at Object.openSync (node:fs:585:3)
at Object.writeFileSync (node:fs:2170:35)
at Object.proxyLoader (/app/node_modules/@sentry/nextjs/cjs/config/loaders/proxyLoader.js:68:17)
Current only workaround is to set autoInstrumentServerFunctions: false
. Is there any other way?
(@sentry/nextjs
: 7.15.0, next
: 12.3.1)</div>
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Advanced Features: Output File Tracing - Next.js
During a build, Next.js will automatically trace each page and its dependencies to determine all of the files that are needed for deploying...
Read more >Module not found: Can't resolve 'fs' in Next.js application
In this module, we have one server-only method and one "shared" method that in theory should work client-side (but as we'll see, theory...
Read more >Next.js API routes: How to read files from directory ... - Medium
The data is expected to be an array of image paths. API Route: The wrong approach. The approach, as proposed here, works to...
Read more >Using Next.js with Expo for Web
js CLI and not with npx expo start . Next.js can only be used with Expo for web, this doesn't provide Server-Side Rendering ......
Read more >The Ultimate Guide to Next.js Authentication with Auth0
The Custom Server Approach. A very common (but legacy) deployment model you'll see with Next.js is where you use a custom server to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If we can get the rollup to do it without temporary files, this issue might solve the problem.
https://github.com/getsentry/sentry-javascript/blob/7e03836d4859b28f52c01a06dd4bc2f20ea849c6/packages/nextjs/src/config/loaders/proxyLoader.ts#L53-L71
Yes for now, but we can look at improving this. PRs are also welcome if you have any ideas.