quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.71k stars 3.49k forks source link

SSR mode on: redirect adds publicPath twice /main/main/info SSR mode off: anything is fine /main/info #17030

Closed christian-beckmann closed 4 months ago

christian-beckmann commented 5 months ago

What happened?

URL redirect will dublicate publicPath, i.e.

/main/info

becomes

/main/main/info

SSR Mode ON

See code https://github.com/quasarframework/quasar/blob/74f13af3e8bb17f08eb1b77582cb09103c2757fa/app-webpack/templates/entry/server-entry.js#L63C2-L63C122

Maybe router.resolve(url).href has already added publicPath

try { return <%= build.publicPath === '/' ? 'router.resolve(url).href' : 'addPublicPath(router.resolve(url).href)' %> }

Example

redirect({ name: 'InfoPage' });

with routes

... path: '/', component: () => import('layouts/MainLayout.vue'), children: [ { path: 'info', name: 'InfoPage', component: () => import('pages/InfoPage.vue'), }, ...

I prepared a stackblitz example, it starts at / (IndexPage) which should redirects to /main/info It works with inactive SSR mode OFF, so it redirects to /main/info

If you open stackblitz it runs with SSR MODE off, when cancelling the command (Ctrl+C) and enter

quasar dev -m ssr

it reruns with SSR MODE on and the /main/main/info leads to 404 page

What did you expect to happen?

/main/info will stay /main/info if using

redirect({ name: 'InfoPage' });

Reproduction URL

https://stackblitz.com/edit/quasarframework-3pntfa?file=src%2Fpages%2FInfoPage.vue

How to reproduce?

https://stackblitz.com/edit/quasarframework-3pntfa?file=src%2Fpages%2FInfoPage.vue

I prepared a stackblitz example, it starts at / (IndexPage) which should redirects to /main/info It works with inactive SSR mode OFF, so it redirects to /main/info

If you open stackblitz it runs with SSR MODE off, when cancelling the command (Ctrl+C) and enter

quasar dev -m ssr

it reruns with SSR MODE on and the /main/main/info leads to 404 page

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Chrome, Other

Quasar info output

quasar info (stackblitz)

Operating System - Linux(5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36) - linux/x64
NodeJs - 18.18.0

Global packages
  NPM - 10.2.3
  yarn - 1.22.19
  @quasar/cli - undefined
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.15.1 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.8.0 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.16.9 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.4.21 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.3.0
  pinia - Not installed
  vuex - Not installed
  vite - 2.9.17 -- Native-ESM powered web dev build tool
  eslint - 8.57.0 -- An AST-based pattern checker for JavaScript.
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - quasarframework3pntfa-0urx
  en0 - 192.168.1.104

Relevant log output

No response

Additional context

No response

christian-beckmann commented 5 months ago

Is anybody out there?

christian-beckmann commented 4 months ago

Is quasar abandoned?

rstoenescu commented 4 months ago

Will look into it. We're handling a lot of things which is why this delay happened.

rstoenescu commented 4 months ago

Fix will be available in: