@sentry/nextjs: can't read data inside next-compose-plugins
See original GitHub issue- 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.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
sentry/nextjs: can't read data inside next-compose-plugins
sentry /nextjs: can't read data inside next-compose-plugins.
Read more >Failed to load next.config.js - Stack Overflow
If you build the repository inside a different environment, where a different Node.js version is referenced (e.g. in Webstorm vs. a separate ...
Read more >sassoptions nextjs | The AI Search Engine You Control
If you want to configure the Sass compiler, use sassOptions in next.config.js. const path = require ('path'); module. exports = {sassOptions: {includePaths: ...
Read more >How to Start Using Sentry: Application Monitoring for Next.js
I use Sentry in a few different applications so I thought I'd show you how you can implement this in Next.jsFollow me on:...
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
@AbhiPrasad hi, it looks like SentryWebpackPluginOptions is being ignored when using withSentryConfig inside withPlugins. Reproduction:
When using withSentryConfig outside of plugins, as in the example above, SentryWebpackPluginOptions works as expected - release ‘qwe’, loading source maps into Sentry was called (terminal: ‘Authentication credentials were not provided’, as expected)
Unfortunately all of our resources this quarter have been aimed at getting our new major out the door, so I haven’t gotten a chance to work on this any more.
(I’m sorry - I know that’s not a super satisfying answer. Once the major’s out, I can bring this up again with the team.)