Closed
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
@sentry/nextjs
Version:
"@sentry/nextjs": "^6.4.1",
"next": "^10.2.1",
Description
FYI: We start projects with version < 10.0.0 and then we are upgrading to the latest version.
Previously we have a setting in our next.config.js
like this.
const withCss = require("@zeit/next-css");
const withSass = require("@zeit/next-sass");
const withPlugins = require("next-compose-plugins");
const withImages = require("next-images");
module.exports = withPlugins([withCss, withSass, withImages], {
env: {
SENTRY_DSN: "xxx",
}
});
Then we change the structure like in the documentation, become like this:
const { withSentryConfig } = require("@sentry/nextjs");
const withCss = require("@zeit/next-css");
const withSass = require("@zeit/next-sass");
const withPlugins = require("next-compose-plugins");
const withImages = require("next-images");
const moduleExports = withPlugins([withCss, withSass, withImages], {
env: {
SENTRY_DSN: "xxx",
}
});
// other codes
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
When we run the app, env can't read with a struct like that. (start from this we are confused)
But, when we are changing the structure like this:
const { withSentryConfig } = require("@sentry/nextjs");
const moduleExports = {
env: {
SENTRY_DSN: "xxx",
}
};
// other codes
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
The app can run fine, but the problem is we don't want to change like that because we are still using the next-compose-plugins.
Is there any recommendation for us, thank you.