PWA: restrict navigateFallback to portal routes only
The service worker was intercepting iframe navigation to app paths
(/notices/, /kitchen/ etc.) and serving the portal's cached index.html
before the request reached nginx — causing the 🚧 EmbeddedFallback.
Only apply the fallback to portal routes; everything else goes to network.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0d15730789
commit
1dd265b46d
1 changed files with 4 additions and 0 deletions
|
|
@ -22,6 +22,10 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
workbox: {
|
workbox: {
|
||||||
navigateFallback: '/index.html',
|
navigateFallback: '/index.html',
|
||||||
|
// Only apply the navigation fallback to the portal's own routes.
|
||||||
|
// App sub-paths (/notices/, /kitchen/, etc.) must reach nginx so
|
||||||
|
// the portal nginx can proxy them to the correct app container.
|
||||||
|
navigateFallbackAllowlist: [/^\/($|login|app\/|admin\/)/],
|
||||||
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue