Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service worker file sw.js is missing on Vercel after fast re-deploys with target static #352

Closed
kfrederix opened this issue Sep 17, 2020 · 4 comments
Labels

Comments

@kfrederix
Copy link

This issue is related to the combination of:

  • new target: static improvements introduced in nuxt 2.14.0
  • this pwa module, which generates sw.js during webpack build
  • static hosting platforms like Vercel

Versions

  • nuxt: 2.14.5
  • node: 12.x

Steps to reproduce

  1. Create new nuxt app with target: 'static'
  2. Add @nuxtjs/pwa module
  3. Deploy to vercel (using build command: nuxt generate)
  4. Observe sw.js is there (= ok)
  5. Trigger web hook for re-deploy (will skip webpack build)
  6. Observe sw.js is missing (= not ok)

What is Expected?

sw.js should be present after fast generate using previous build cache (skipping webpack build).

What is actually happening?

sw.js is missing after fast generate using previous build cache (skipping webpack build).

So it seems to me like the generated sw.js file is not included in the build cache which is stored on Vercel, and therefore it will get missed when doing fast re-deploys which skip the webpack build step.

Not sure if this issue belongs here, or rather in the actual nuxt.js repo...

@pi0 pi0 added the bug label Oct 6, 2020
@codeofsumit

This comment has been minimized.

@pi0
Copy link
Member

pi0 commented Oct 7, 2020

@codeofsumit nop please see #365 (fixed in v3.1.1)

@pi0
Copy link
Member

pi0 commented Oct 13, 2020

Hi. Sorry for inconveniences. This issue should be resolved by v3.2.0

@pi0 pi0 closed this as completed Oct 13, 2020
@kfrederix
Copy link
Author

Thanks @pi0 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants