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

How to exclude a backend route when online #827

Open
SteamWind opened this issue Feb 27, 2025 · 0 comments
Open

How to exclude a backend route when online #827

SteamWind opened this issue Feb 27, 2025 · 0 comments

Comments

@SteamWind
Copy link

SteamWind commented Feb 27, 2025

Hello, I'm experiencing the same kind of problem as this issue but in my case, I want it to work when the user is online.
I tried the configuration of workbox like this:

            workbox: {
                globPatterns: ["**/*.{js,css,html,svg,png,ico,gif}"],
                cleanupOutdatedCaches: true,
                clientsClaim: true,
                navigateFallbackDenylist: [
                    /^\/mybackend.*/,
                ],
            },

When I put me online, the redirection works for any route but /mybackend, which is expected. When I navigate to /mybackend, I get a no network error, which is expected too.
But in my situation, when the network is on, I'm redirected to the app anyway, even when I navigate to /mybackend.
How to have the same behavior when network is online and being redirected to the real page I want on /mybackend, which is not my vite app?

I'm using vite-plugin-pwa version 0.21.1. I've got a vue app on root but different servers on other routes like /mybackend.

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

1 participant