-
Notifications
You must be signed in to change notification settings - Fork 131
SWs redirect user to /auth on refresh in production #49
Comments
After integrating my own API server, all refreshes lead to auth page. SSR only, which is weird. I'm guessing I need to call my own api server inside of the express server or implement a similar endpoint? |
@TheDolo, I found the probable error reason, it's because of auth middleware on the server. Something goes wrong with this middleware + cookies + SSR. Will be fixed as soon as possible, I agree it's a critical bug. |
P.S I found I needed a shift refresh between SSR builds, else even a new tab would load the old build. I'd be in dev mode then build, and find the build was the older one. It's caught me off guard many times heh. TY!! |
@TheDolo I found the reason of this error. It was caused by invalid property name inside SSR's UPD: it's not the only bug :( |
@TheDolo It seems like the issue is caused by SWs fallBackURL, I disable OfflinePlugin and it works perfectly. Try to check this deployment of app. Probably, when a user requests app '/' path, server doesn't handle this because the request is handled by ServiceWorkers. UPD: OfflinePlugin is required additional configuration, if you want to patch your app - disable Offline plugin or replace current OfflinePlugin config in new OfflinePlugin({
publicPath: '/',
caches: {
main: [
'vendor.*.js',
'vendor.*.css',
'manifest.*.js',
'client.*.js'
]
},
excludes: ['/', ''],
externals: ['/auth'],
rewrites: () => {
return ''
},
ServiceWorker: {
navigateFallbackURL: '/auth',
navigateFallbackForRedirects: false
},
AppCache: false
}) Optimized patch will be soon. |
#56 includes patch for this issue |
Fixed for me! Thank you. |
I'm submitting a ...
Bug Report:
Refreshing page on dashboard cycles through auth
Steps to reproduce:
git clone, npm install, npm run build, npm run start
The text was updated successfully, but these errors were encountered: