close
The Wayback Machine - https://web.archive.org/web/20220223205943/https://github.com/nuxt/nuxt.js/pull/9010
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

fix(vue-app): use app.context.route to match components in server #9010

Merged
merged 2 commits into from Mar 22, 2021
Merged

Conversation

@enwin
Copy link
Contributor

@enwin enwin commented Mar 18, 2021

Replaced router.match(ssrContext.url) with app.context.route to get matched components when generating a page server side.

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Using router.match(ssrContext.url) would not take into account any navigation guard that might modify the end route. In some cases the resulting matched components will not be the expected one. Resolves: #9009

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.
@clarkdo clarkdo requested review from danielroe and pi0 Mar 19, 2021
pi0
pi0 approved these changes Mar 22, 2021
Copy link
Member

@pi0 pi0 left a comment

LGTM

@pi0 pi0 changed the title fix: use app.context.route instead of router.match(ssrContext.url) to match components fix(vue-app): use app.context.route to match components in server Mar 22, 2021
@pi0 pi0 merged commit e8ea376 into nuxt:dev Mar 22, 2021
20 checks passed
@pi0 pi0 mentioned this pull request Mar 31, 2021
@fahdaddi
Copy link

@fahdaddi fahdaddi commented Apr 26, 2021

Hey @pi0, after upgrading my nuxt app to latest release I got an error when navigating to any page different than the home page, it shows the error: This page could not be found! while it was working perfectly in the nuxt@2.15

example of my pages config:

export default {
  home: {
    frFR: '/:amp?',
    frBE: '/:amp?',
    itIT: '/:amp?'
  },
  'about-us/legal-terms': {
    frFR: '/a-propos/mentions-legales/:amp?',
    frBE: '/a-propos/mentions-legales/:amp?',
    itIT: '/a-propos/mentions-legales/:amp?'
  },
}

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

Successfully merging this pull request may close these issues.

5 participants