Giter VIP home page Giter VIP logo

Comments (9)

userquin avatar userquin commented on July 18, 2024 3

To allow your app work offline you need precaching in the service worker and so at least one static page acting as app shell: you will need to add nitro.prerender.routes: ['/'] to your nuxt configuration.

from nuxt.

RifatMahmudno-1 avatar RifatMahmudno-1 commented on July 18, 2024 1

Doesn't work. I tried adding navigateFallback: '/'. The error is still there.
Then I tried this and it worked:
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,jpg,ttf}'],
navigateFallback: null,
additionalManifestEntries: [{ url: '/', revision: new Date().getTime().toString() }]
},

from nuxt.

userquin avatar userquin commented on July 18, 2024 1

@RifatMahmudno-1 you can also use workbox: { navigateFallback: null } }and remove the prerender, the browser will show something similar to the dinosaur page (chrome)

from nuxt.

RifatMahmudno-1 avatar RifatMahmudno-1 commented on July 18, 2024

registerType: 'autoUpdate',
registerWebManifestInRouteRules: true,
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,jpg,ttf}']
},

from nuxt.

userquin avatar userquin commented on July 18, 2024

@RifatMahmudno-1 add navigateFallback: '/' to workbox option, you can check it in playground configuration https://github.com/vite-pwa/nuxt/blob/main/playground/nuxt.config.ts#L38

from nuxt.

userquin avatar userquin commented on July 18, 2024

@RifatMahmudno-1 check this comment #14 (comment), there are a few hints and also a few repo links

from nuxt.

userquin avatar userquin commented on July 18, 2024

@RifatMahmudno-1 on build or dev? if you're using dev with devOptions.enabled = true add the same entry devOptions.navigateFallback = '/'

can you provide a repo link (GitHub or stackblitz)?

from nuxt.

RifatMahmudno-1 avatar RifatMahmudno-1 commented on July 18, 2024

You can clone this repository, run and reproduce that error.
Run in production mode. npm run build && npm run preview
Repo link

from nuxt.

RifatMahmudno-1 avatar RifatMahmudno-1 commented on July 18, 2024

Working Thanks

from nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.