require is not accepted in next.config.js but needed for sentry support
Answered
Short-tailed Albatross posted this in #help-forum
Short-tailed AlbatrossOP
thats it. how to handle require in next.config.js
Answered by joulev
if you use next.config.mjs,
if you use next.config.js
the file extension is important.
import { withSentryConfig } from "@sentry/nextjs";if you use next.config.js
const { withSentryConfig } = require("@sentry/nextjs");the file extension is important.
3 Replies
@Short-tailed Albatross thats it. how to handle require in next.config.js
if you use next.config.mjs,
if you use next.config.js
the file extension is important.
import { withSentryConfig } from "@sentry/nextjs";if you use next.config.js
const { withSentryConfig } = require("@sentry/nextjs");the file extension is important.
Answer
Short-tailed AlbatrossOP
yea i had toswitch to this and play around with the logic inside the file as well
thank you very much for responding