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

router.base is sanitized with trailing slash which does not match with path wihout trailing slash (spa mode only) #6744

Closed
crutch12 opened this issue Nov 28, 2019 · 3 comments · Fixed by #6745

Comments

@crutch12
Copy link

crutch12 commented Nov 28, 2019

Version

v2.10.2

Reproduction link

https://codesandbox.io/s/example-hello-world-no8hn

Steps to reproduce

Set nuxt.config

{
  mode: 'spa',
  router: {
    base: "/app"
  }
}

Open localhost:3000/app

What is expected ?

index.vue file from pages dir

What is actually happening?

404 This page could not be found

Additional comments?

Works fine if open localhost:3000/app/

Works fine in universal mode, but logs ssr error (The client-side rendered virtual DOM tree is not matching...)

It's happening because of getLocation function (https://github.com/nuxt/nuxt.js/blob/701f2d033bbc421f85f888f9bf9100b176aac818/packages/vue-app/template/utils.js#L267) and because of router.base is sanitizing with trailing slash (https://github.com/nuxt/nuxt.js/blob/dev/packages/config/src/options.js#L93)

So I propose change getLocation function

@stale
Copy link

stale bot commented Dec 28, 2019

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

@stale stale bot added the stale label Dec 28, 2019
@stale stale bot closed this as completed Jan 4, 2020
@renzosunico
Copy link

Hi,

Is there a workaround for this? I noticed that the merge request is still open. Thank you.

@pi0 pi0 reopened this Jun 22, 2020
@stale stale bot removed the stale label Jun 22, 2020
@pi0 pi0 closed this as completed in #6745 Jun 30, 2020
@pi0 pi0 reopened this Jun 30, 2020
@pi0 pi0 mentioned this issue Jun 30, 2020
@stale
Copy link

stale bot commented Jul 31, 2020

Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of nuxt-edge
  2. Comment the steps to reproduce it

Issues that are labeled as pending will not be automatically marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants