Closed heldr closed 2 years ago
Hey thanks for writing in, we are taking a look! In the mean time, to help us debug, could you provide your webpack version and your next.config.js
if possible? A repro app of some sort will also help a lot!
I have a quick theory that https://nextjs.org/docs/api-reference/edge-runtime is causing issues here. As per their section on unsupported APIs:
Native Node.js APIs are not supported. For example, you can't read or write to the filesystem
Not sure why they would be running at build time though, so maybe I'm wrong 🤔.
@AbhiPrasad you are actually right!
I just setup one codesandbox example where commenting the following edge api runtime avoids the issue.
export const config = {
runtime: 'experimental-edge'
};
I'm going to ignore those edge functions on Sentry config on meantime.
Edge api function example. https://codesandbox.io/s/headless-sun-xqrqgj?file=/pages/api/geoip.js
please set the following env var secrets:
SENTRY_ORG
SENTRY_PROJECT
SENTRY_AUTH_TOKEN
NEXT_PUBLIC_SENTRY_DSN
then open a new terminal and run
yarn build
See https://github.com/vercel/next.js/issues/36776 for more details. Yeah we don't support middleware at the moment, this is being tracked here: https://github.com/getsentry/sentry-javascript/issues/4206
Apparently adding edge route api to ignoreFile
and ignore
array CLI config doesn't avoid issue.
Bug reported was fixed on Next.js 12.2.1 by this changed https://github.com/vercel/next.js/pull/38234
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.5.0
Framework Version
7.5.0
Link to Sentry event
No response
Steps to Reproduce
After upgrading to Next.js 12.2.0, webpack plugin
withSentryConfig
seems to fail when CLI tries to update and upload source maps.Expected Result
CLI is expected to recognize Node.js modules.
Actual Result
Getting this error
even if all those modules are already skipped on non-server builds.