hanford / next-offline

make your Next.js application work offline using service workers via Google's workbox
https://github.com/hanford/next-offline
1.59k stars 111 forks source link

The static/ directory is deprecated. Use the public/ directory instead. #216

Open jasonharrison opened 4 years ago

jasonharrison commented 4 years ago
build-secure@vopz1 OVERLAY_READONLY$ cross-env NODE_ENV=production next build
 [1:19:15 PM] Compiled client in 29s
Creating an optimized production build  

...

One of the glob patterns doesn't match any files. Please remove or fix the following: {
  "globDirectory": ".",
  "globPattern": *static/**/*",      // <--- this needs to be changed
  "globIgnores": [
    "**/node_modules/**/*"
  ]
}

The static/ directory was deprecated in Next 9.0.6; we should use the public/ directory instead.

Looks like https://github.com/hanford/next-offline/blob/master/packages/next-offline/index.js#L13 needs to be changed. Anything else?

rohmanhm commented 4 years ago

Looks like they are already implementing that and then revert the commit. https://github.com/hanford/next-offline/commit/d16b381812ba8ecc623f7b792c86ff2956c97bb8

hanford commented 4 years ago

yeah @rohmanhm it caused a major regression, which IIRC entirely broke next-offline

I'd love a PR if someone wants to dig in to this though!

mattvb91 commented 4 years ago

So currently with next 9.2 this package is unusable correct? Or is there a workaround?

hanford commented 4 years ago

@mattvb91 I'm using next-offline with Next 9.2 in several projects.

https://github.com/hanford/personal-website https://github.com/hanford/trends

I'm not experiencing any issues. Feel free to create an issue if you run into anything.