https://github.com/devsky/nuxt-spa-redirect-error
All tested with mode:'spa' in nuxt.config.js Also saw similar behavior without spa mode, but could be expected due to SSR
dist folder running serve -p 8000. (node server on port 8000)
npm run generate then test what the node server has in a new incognito window
localhost:8000/ relative link -> /relative -(redirect)-> /relative-dest absolute -> /absolute -(redirect)-> http://localhost:8000/relative-dest absolute-ext -> /absolute-ext -(redirect)-> http://www.google.com
redirects are in each their own middleware absolute uses a layout layer middleware to redirect
red flash is from the error template rendering, not in example but on actual projects have seen the error message ERR_REDIRECT
1.4 relative link: straight to relative-dest absolute link: flashes red / console.log fired on error layout mounted absolute-ext link: flashes red
direct-absolute : flashes red direct-absolute-ext : flashes red
1.3 / 1.2: relative link: straight to relative-dest absolute link: intermittent flash, didn't mounted console.log in when testing absolute-ext link: flashes red
direct-absolute : flashes red direct-absolute-ext : flashes red
1.1 (This is the expected outcome, back button functionality also retained here) relative : straight to relative-dest absolute : straight to relative-dest absolute-ext : straight to google
direct-absolute : straight to relative-dest direct-absolute-ext : straight to google
The browser back button functionalty also becomes strange after 1.2. I would expect in every scenario the back button would act like the relative example.
Relative paths work as expected (did not test relative paths but external to app)
Absolute paths and absolute external paths I would expect to function as they did in version 1.1 which is identical to how relative paths currently function.
Error page gets rendering before the redirect occurs since 1.2 if the redirect is to an absolute path.
Absolute paths the point to another location in the app seemed to flash intermittently on 1.2/1.3/1.4 but after adding a log message to mounted on the error template I saw it on every navigation to the internal absolute path
Absolute paths that point to an external website (http://www.google.com) will always render the error template.
Just started setting up a new project with nuxt, since a successful release of our first app built on nuxt with ongoing development. As I started to bring over and improve some of the auth/entry handling code set up in the first project, I noticed the login redirects would render the error page before navigating to the location for our login portal. Compared side by side with our 1.1 project and did not see the same thing happening, am also able to repro this in the auth0 example but that takes a little more work to get set-up and running so made this super bare bones example.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This bug report is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c7031">#c7031</a>)</em></sub></div>