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 — with CMTY · 3 comments

Comments

Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
Copy link
Contributor

@crutch12 crutch12 commented Nov 28, 2019 — with CMTY

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 (

if (base && path.indexOf(base) === 0) {
) 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 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.

Loading

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

@renzosunico renzosunico commented Mar 4, 2020 — with CMTY

Hi,

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

Loading

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

@stale 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.

Loading

@stale stale bot added the stale label Jul 31, 2020
@crutch12 crutch12 closed this Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment