Closed sbh96 closed 2 years ago
It looks like the reproduction repo is private, I get 404. Could you make it public so I can have a look? :pray:
I don't think @types/react
should affect webpack though. :thinking:
It looks like the reproduction repo is private, I get 404. Could you make it public so I can have a look? 🙏
I don't think
@types/react
should affect webpack though. 🤔
Yes thats right i fix it with this Ref
Haven't look into this but it may be an issue with how you are using next-pwa. Current next-pwa documentation shows that it should be initialized like so
const withPWA = require('next-pwa')({
dest: 'public'
// disable: process.env.NODE_ENV === 'development',
// register: true,
// scope: '/app',
// sw: 'service-worker.js',
//...
})
module.exports = withPWA({
// next.js config
})
With the import being a function that includes next-pwa options. I have not tested any of this so this is 100% an assumption on my part, based on a quick glance at what has been provided.
I was having a similar error.
I solved by updating next-pwa dependency to its latest version (from ^5.3.1 to ^5.6.0) and, as @grayaustinc suggested, modified next.config.js in order to initialize next-pwa as documentation shows.
this worked for me
https://github.com/shadowwalker/next-pwa/issues/398#issuecomment-1236069816
this worked for me
const runtimeCaching = require("next-pwa/cache");
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
runtimeCaching,
buildExcludes: [/middleware-manifest.json$/],
});
const nextConfig = withPWA({
// next config
});
module.exports = nextConfig;
It seems the readme has been updated on npm
with suggestions from other comments, I got this to throw no errors:
/** @type {import('next').NextConfig} */
const runtimeCaching = require("next-pwa/cache");
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
runtimeCaching,
buildExcludes: [/middleware-manifest.json$/],
disable: process.env.NODE_ENV === "development",
});
const nextConfig = withPWA({
reactStrictMode: true,
swcMinify: true,
i18n: {
locales: ["fr"],
defaultLocale: "fr",
},
});
module.exports = nextConfig;
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.
Haven't look into this but it may be an issue with how you are using next-pwa. Current next-pwa documentation shows that it should be initialized like so
const withPWA = require('next-pwa')({ dest: 'public' // disable: process.env.NODE_ENV === 'development', // register: true, // scope: '/app', // sw: 'service-worker.js', //... }) module.exports = withPWA({ // next.js config })
With the import being a function that includes next-pwa options. I have not tested any of this so this is 100% an assumption on my part, based on a quick glance at what has been provided.
It worked for me ! Thank you so much ! a BIG HELP !
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
my packge json:
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
next dev
Describe the Bug
after this issue : ref after upgrade @types/react to "18.0.1" this error shows to me
[WebpackGenerateSW] 'trailingSlash' property is not expected to be here. Did you mean property 'include'?
i also remove trailingSlash but after that error comes up:
[WebpackGenerateSW] 'images' property is not expected to be here. Did you mean property 'include'?
Expected Behavior
These settings work well on one of my computers, which I already had the packages from several months ago, and exactly with the same version of the packages, but when I try to run it on another system with the yarn install && yarn dev command, an error occurs. I feel that this problem is due to the new version of typescript, but I have no idea about it
Link to reproduction
https://gitlab.com/sadrakeshtar/nabrika-front
To Reproduce