shadowwalker / next-pwa

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

BlitzJS: Not working in Production, deployed on Vercel #317

Closed utsavdotpro closed 2 years ago

utsavdotpro commented 2 years ago

Summary

Trying to convert my BlitzJS into a PWA. I have a middleware added in my config file which is getting lost (only in production, deployed on Vercel) when wrapping with withPWA(), but is working perfectly on localhost.

The blitz.config.ts:

import { customIsAuthorized } from "app/core/auth-adapter"
import { BlitzConfig, sessionMiddleware } from "blitz"

const withPWA = require("next-pwa")

const config: BlitzConfig = {
  middleware: [
    sessionMiddleware({
      cookiePrefix: "project-name",
      isAuthorized: customIsAuthorized,
    }),
  ],
}

module.exports = withPWA({
  pwa: {
    dest: "public",
  },
  ...config,
})

Please help me with

Versions

How To Reproduce

Steps to reproduce the behavior:

Link to minimal reproduces setup repository if any. NA

Expected Behaviors

As mentioned above

Screenshots

NA

Additional Context

NA

utsavdotpro commented 2 years ago

next-pwa works well with Blitz 2.0 without any additional configurations.

Also, duplicate of https://github.com/shadowwalker/next-pwa/issues/80

Closing!