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

Could not find a declaration file for module 'next-offline' #303

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

Could not find a declaration file for module 'next-offline' #303

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

Comments

@w8ze-devel
Copy link

Hello,

Thanks very much for this project. I've just discovered it while searching about how to implement offline mode in my nextjs application.

Please consider the following items when filing a bug report:

  • Issue and steps to reproduce.

Just made a yarn add next-offline and try to build my application.

Here is my complete next.config.js

//@ts-check
const withOffline = require('next-offline');

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { composePlugins, withNx } = require('@nx/next');

/**
 * @type {import('@nx/next/plugins/with-nx').WithNxOptions}
 **/
const nextConfig = {
  nx: {
    svgr: true,
  },
  workboxOpts: {
    runtimeCaching: [{
      handler: 'StaleWhileRevalidate',
      options: {
        cacheName: 'assets-cache',
        expiration: {
          maxEntries: 5,
          maxAgeSeconds: 60,
        },
      },
    }],
  }
};

const plugins = [
  withNx,
];

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

  • Versions.
    The installed version is 5.0.5

  • Screenshots.
    image

  • Expected.

The build is done properly.

  • Actual.

The error in the above screenshoot.

  • Browser name and version.

Try on Chrome and Edge (latest version)

Thanks for advance for your help.

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