Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service workers are not generated #305

Open
w8ze-devel opened this issue Jul 17, 2023 · 0 comments
Open

Service workers are not generated #305

w8ze-devel opened this issue Jul 17, 2023 · 0 comments

Comments

@w8ze-devel
Copy link

Hello,

I've made the minimal configuration but yet no service-workers are generated.

  • Issue and steps to reproduce.

Just have this next.config.js and build my nextJs application

//@ts-check
const { composePlugins, withNx } = require('@nx/next');

/**
 * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  nx: {
    svgr: true,
  },
  workboxOpts: {
    swDest: 'public/service-worker.js',
    runtimeCaching: [{
      urlPattern: /^http?.*/,
      handler: 'StaleWhileRevalidate',
      options: {
        cacheName: 'joimport-assets-cache',
        expiration: {
          maxEntries: 20,
          maxAgeSeconds: 600,
        },
      },
    }],
  }
};

const plugins = [
  // Add more Next.js plugins to this list if needed.
  require('next-offline'),
  withNx,
];

module.exports = composePlugins(...plugins)(nextConfig);

And here is the output

image

I can see my custom service workers but nothing more.

image

  • Versions.
    5.0.5

  • Screenshots.
    Please see above

  • Expected.

Service worker generated and loaded

Tried Edge and Chrome (latest version)

Please, any help would be appreciate.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant