shadowwalker / next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰
MIT License
3.87k stars 324 forks source link

Is next-pwa is deprecated? #241

Open satyamskillz opened 3 years ago

satyamskillz commented 3 years ago

Summary

Recently, I noticed that NextJS 11 is shifted to Webpack 5 and JEST is renamed to JOI. when I am running my application production or development is don't see next-PWA generating any files. and I got these warnings during installation.

warning next > native-url > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning next > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning next-pwa > workbox-webpack-plugin > workbox-build > rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi@15.1.1: Switch to 'npm install joi'
warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained        
warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained        
warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained      
warning next-pwa > workbox-webpack-plugin > workbox-build > strip-comments > babel-plugin-transform-object-rest-spread > babel-runtime > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > next-pwa@3.1.5" has unmet peer dependency "webpack@>=4.0.0".
warning "next-pwa > clean-webpack-plugin@3.0.0" has unmet peer dependency "webpack@*".
warning "next-pwa > workbox-webpack-plugin@5.1.4" has unmet peer dependency "webpack@^4.0.0".

When I tried to run the old Nextjs example from here link I got these warnings. what is happing?

(node:11604) [DEP_WEBPACK_SINGLE_ENTRY_PLUGIN] DeprecationWarning: SingleEntryPlugin was renamed to EntryPlugin
(Use `node --trace-deprecation ...` to show where the warning was created)
> [PWA] Compile client (static)
> [PWA] Build in develop mode, cache and precache are mostly disabled. This means offline support is disabled, but you can continue developing other functions in service worker.
> [PWA] Auto register service worker with: D:\NEXT-JS\progressive-web-app\node_modules\next-pwa\register.js
> [PWA] Service worker: D:\NEXT-JS\progressive-web-app\public\sw.js
> [PWA]   url: /sw.js
> [PWA]   scope: /
> [PWA] Compile server
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
(node:11604) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.

Versions

shadowwalker commented 3 years ago
  1. What make you think next-pwa is deprecated?
  2. What make you think "JEST is renamed to JOI"?
  3. I don't maintain the example inside next.js repository unfortunately, does the examples in this repository not good enough for you?
satyamskillz commented 3 years ago
  1. What this line means (node:11604) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated?
  2. warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi@15.1.1: Switch to 'npm install joi'.
  3. Yes, I understand that most of the next.js examples are outdated, after this recent version update most of the examples are giving deprecation warning. my application is totally dependent on pwa, that's why I don't want to use any packages such as next-pwa and next-sitemap which might cause problems in future.
renomureza commented 3 years ago

I have installed this plugin and when this plugin is uninstalled, Vercel returns 500 internal server error.

This seems to be messing with package-lock.json (babel/core), hope this can be a hint of a fix.

I was stuck in the same problem, finally solved. Remove target: 'serverless' in next.config.js. Ref: https://github.com/vercel/next.js/issues/10633