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?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.22.0
Framework Version
13.0.5
Link to Sentry event
No response
Steps to Reproduce
After upgrading @sentry/nextjs from 7.21.1 to 7.22.0, the environment variables in next.config.js get dropped and can no longer be accessed from next app.
// next.config.js
const { withSentryConfig } = require("@sentry/nextjs");
const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: process.env.ANALYZE === "true" });
const moduleExports = { env: { myConfig: 'MY_CONFIG' }, ... }
const SentryWebpackPluginOptions = { silent: true };
module.exports = withBundleAnalyzer(withSentryConfig(moduleExports, SentryWebpackPluginOptions));
The config code above worked fine before 7.22.0.
At 7.22.0 it would work if withBundleAnalyzer is removed though.
Expected Result
In next app console.log(process.env.myConfig) should print MY_CONFIG on browser.
Actual Result
console.log(process.env.myConfig) prints undefined