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

bug: Ionic Vue Router throwing error when its running on server in SSR mode. #23254

Closed
siddiquipro opened this issue May 3, 2021 · 6 comments
Labels
package: vue @ionic/vue package type: bug a confirmed bug report

Comments

@siddiquipro
Copy link
Contributor

siddiquipro commented May 3, 2021

Bug Report

Ionic version:

[ ] 4.x
[x] 5.x

Current behavior:

Running ionic vue with SSR with ionic router, the @ionic/vue-router throws an error about history is not defined when it is running on server.

Expected behavior:

The error should not trigger.

Steps to reproduce:

clone the repo https://github.com/mohammadsiddiqui/vue-ionic-ssr and build it and run it in SSR mode and look at the server console.
Related code:

insert short code snippets here

Other information:

Ionic info:

image

insert the output from ionic info here
@ionitron-bot ionitron-bot bot added the triage label May 3, 2021
@siddiquipro siddiquipro changed the title bug: Ionic Vue Router throwing error when its running on server. bug: Ionic Vue Router throwing error when its running on server in SSR mode. May 3, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue and PR! Could your provide some more steps to reproduce? I am trying to run the app in SSR mode, but I do not get the history is not defined error.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label May 3, 2021
@ionitron-bot ionitron-bot bot removed the triage label May 3, 2021
@siddiquipro
Copy link
Contributor Author

In the repo, I forgot to add back vue-router dependency as I was testing without ionic-router which I did now. you can run the same now.
Node: 12.16.3
NPM: 6.14.5

I have recorded a video demonstrating the issue, please find the link here.

https://player.vimeo.com/video/544647326

image

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels May 3, 2021
@liamdebeasi
Copy link
Contributor

Thanks, that makes sense. I left a comment on your PR.

@liamdebeasi liamdebeasi added package: vue @ionic/vue package type: bug a confirmed bug report labels May 3, 2021
@ionitron-bot ionitron-bot bot removed the triage label May 3, 2021
@liamdebeasi
Copy link
Contributor

Also here is a dev build of your changes if you would like to test them in your app:

npm install @ionic/[email protected] @ionic/[email protected]

@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #23255, and a fix will be available in an upcoming release of Ionic Framework.

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 2, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: vue @ionic/vue package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants