shadowwalker / next-pwa

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

next pwa config override next config: Experimental ServerMinify #495

Closed JJDSNT closed 8 months ago

JJDSNT commented 8 months ago

Im using typeORM, and had issues with minify

https://github.com/typeorm/typeorm/issues/4714

  experimental: {
    serverComponentsExternalPackages: ["typeorm", "typedi"],
    serverMinification: false, //typeorm
    esmExternals: 'loose', //oci sdk
  },

it worked ok, but when i add the withPWA, or i get: https://github.com/shadowwalker/next-pwa/issues/398

> [PWA]   scope: /
Failed to compile.

Please check your GenerateSW plugin configuration:
[WebpackGenerateSW] 'pwa' property is not expected to be here.

Or the typeorm issue is back!

JJDSNT commented 8 months ago

Hi,

this solve my issue:

module.exports= {...nextConfig,...withPWA}

l0gicgate commented 7 months ago

Thank you @JJDSNT I looked all over the place for a fix for TypeORM.

I deduced that code minification was my issue. With serverMinification: false I was able to get my build to work!