Closed
Description
Summary
I tried to use the sentry integration with the next-pwa plugin but the service-worker is not register in this configuration.
Versions
next-pwa
: 3.1.0next
:10.2.0@sentry/nextjs
: ^6.3.6
How To Reproduce
Steps to reproduce the behavior:
- Clone this repo
- Install the app with
yarn install
and run it withyarn dev
- Open the navigator on http://localhost:3000/
- Check if a service worker is registered in the chrome dev tools
Expected Behaviors
The sw.js
file and the workbox.js
are created in the public folder but they are not registered by the browser. It only occured when using withSentryConfig.
This is the next.config.js file I used :
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
const { withSentryConfig } = require('@sentry/nextjs')
const moduleExports = withPWA({
pwa: {
dest: 'public',
runtimeCaching,
},
})
const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
}
// With this config, the service worker is not registered by the browser
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions)
// This config works
// module.exports = moduleExports