Skip to content

fix(vue): use correct history mode when doing ssr to avoid errors #23255

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

Merged
merged 2 commits into from
May 3, 2021
Merged

fix(vue): use correct history mode when doing ssr to avoid errors #23255

merged 2 commits into from
May 3, 2021

Conversation

siddiquipro
Copy link
Contributor

@siddiquipro siddiquipro commented May 3, 2021

if this runs in SSR mode, we are getting history is undefined! so I just initialized the history variable from opts.

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: #23254

What is the new behavior?

  • No error
  • SSR works great

Does this introduce a breaking change?

  • Yes
  • No

Other information

I have just added a line to initialize history variable before using it, so on the server it doesn't break

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
if this runs in SSR mode, we are getting history is undefined! so I just initialized the history variable from opts.
@github-actions github-actions bot added the package: vue @ionic/vue package label May 3, 2021
@siddiquipro siddiquipro changed the title initialize history before matching with replace fix (vue-router) : initialize history before matching with replace May 3, 2021
@siddiquipro siddiquipro changed the title fix (vue-router) : initialize history before matching with replace fix(vue-router) : initialize history before matching with replace May 3, 2021
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just need to add the comment I mentioned below.

@liamdebeasi liamdebeasi changed the title fix(vue-router) : initialize history before matching with replace fix(vue) : use correct history mode when doing ssr to avoid errors May 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
@liamdebeasi liamdebeasi changed the title fix(vue) : use correct history mode when doing ssr to avoid errors fix(vue): use correct history mode when doing ssr to avoid errors May 3, 2021
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this PR! I will get this merged once tests pass.

@liamdebeasi
Copy link
Contributor

Merged. Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vue @ionic/vue package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants