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

works with Nuxt 3 #537

Open
mitraecp opened this issue Dec 30, 2022 · 10 comments
Open

works with Nuxt 3 #537

mitraecp opened this issue Dec 30, 2022 · 10 comments

Comments

@mitraecp
Copy link

Hello everyone, first of all I apologize for opening an issue (I didn't find an area to ask questions). I would like to know if this module works with nuxt 3. because when I try to import it in nuxt.config, I get an error.

@clinton9ice
Copy link

Error like this

ERROR  Cannot restart nuxt:  Cannot destructure property 'nuxt' of 'this' as it is undefined.                                                                    13:50:50
  at pwa (node_modules/@nuxtjs/pwa/dist/pwa.js:733:10)
  at installModule (node_modules/@nuxt/kit/dist/index.mjs:416:9)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:1825:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6779:9)
  at async _applyPromised (node_modules/nuxi/dist/chunks/dev.mjs:6713:10)

I'm also having same issue and was hoping to see any result.

@keduardo2117
Copy link

I'm also interested in knowing if this module can work with Nuxt 3, so far I only see solutions or topics related to NuxtJS when searching online

@rahulkumarsingh73690
Copy link

This module is not supported

@ghost
Copy link

ghost commented Jan 26, 2023

@mitraecp I've scoured from what's currently available at this time, others found a solution for a working but unofficial PWA module here created by Kevin - and unfortunately, this is the only way to get a PWA up and running until Nuxt 3 has released a built-in PWA module.

From what I can gather, and from other issues pertaining to this repo, I believe this is going to be a native feature from Nuxt 3 and will be migrating all the features from this repo, however it's still being worked on and not suitable for production yet.

@suruaku
Copy link

suruaku commented Feb 17, 2023

There's also Framework-agnostic PWA plugin by vite-pwa which can be integrated with Nuxt, Vanilla JavaScript, TypeScript or any framework in general.

Installation: https://vite-pwa-org.netlify.app/frameworks/nuxt.html
Examples: https://vite-pwa-org.netlify.app/examples/nuxt.html

@rahulkumarsingh73690
Copy link

@suruaku Is this stable?

@suruaku
Copy link

suruaku commented Feb 17, 2023

Yes, the vite-pwa itself has been around for a few years. The Nuxt3 integration is relatively fresh (like Nuxt3 itself) and is done by Nuxt core team member Daniel.

But especially now, be thoughtful when updating any Nuxt3 plugins in general. Test and read changelogs. Things are changing quite rapidly.

https://github.com/vite-pwa/nuxt

@JenuelDev
Copy link

have you tried to set ssr to false? since PWA should be SPA, I believe.

@SkyaTura
Copy link

The fact that this module does not support Nuxt 3 should be explicit on the WebSite/Docs to avoid time waste

@keduardo2117
Copy link

I believe this is the module we should use for Nuxt 3 projects
https://nuxt.com/modules/vite-pwa-nuxt

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

No branches or pull requests

7 participants