-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Unexpected Rendering behavior when using suspense and router-view #2201
Comments
You need your studio_route component to have one single element at the root and to remove the |
Thanks for the Answer! Completely over saw the last sentence in Evans Comment! Also the other Bug doenst seem to get resolved from this Solution! So ive added a one single element now to all templates and i am still getting the error: Is it essential that each Apparently also this Bug is now shown: Codesandbox is now updated and shows both Bugs. |
Okay, so i removed Before #2099 the |
I've been tracking down this issue and I can confirm that sticking to
I had a few stable projects working on beta version and they suddenly stopped working... Truth is we were warned about a changing API for Suspense from the beginning. This PR shows the changes to get a working Vue3 app back to life: https://github.com/yeikiu/base-vue3-ts/pull/1/files#diff-8ee2343978836a779dc9f8d6b794c3b2L8832 maybe using the |
Version
3.0.0
Reproduction link
Please test this locally too, Codesandbox seems to not put out various Console Errors and loads some Components compared to an Local Environment.
https://codesandbox.io/s/vite-vue3-suspense-router-example-cwf00
Steps to reproduce
Steps to reproduce the Bugs:
1.1 On Local, the Home Route and Studio Route are not rendered
<!---->
. Just by clicking between the Routes multiple Times, the DOM eventually gets rendered1.2 Clickbehavior like the following: Reload (no Home) -> Home -> Studio -> Home (now its rendered)
1.3 It is also possible to infinitely add
<!---->
to the DOM with that method<div></div>
within the default suspense template it will show the following console error:<Suspense>
slots expect a single root node.<div></div>
, vue router will add empty two<!---->
into the dom, these do not exist if Point 2 is active4.1 Refreash the Page and click from home to studio and you wont see "studio1" headline
if the children router-view is not located within a "suspense" same as the app.vue router-view
All these Issues are just occuring since the latest Suspense Change (as far as tested):
#2099
What is expected?
Expected would be that a Route without any params would load on its specific Url, same goes for the Children Routes.
Also there shouldnt be empty dom comments
<!---->
rendered just by adding a empty div to the suspense default template.What is actually happening?
Routes without Params are not showing their specific async Component on local enviroment.
Additional empty dom comments
<!---->
are getting rendered when using empty div tags in suspense default template together with a component slot from router-viewTested on and with:
"@vue/compiler-sfc": "^3.0.0",
"vite": "^1.0.0-rc.4"
"vue": "^3.0.0",
"vue-router": "^4.0.0-beta.11"
Windows 10 64Bit,
Terminal: Integrated VSCode Terminal
Additional
Atm there is no Documentation about how to use
suspense
androuter-view
properly together.There are old Bits out via Youtube Videos but this could lead to some confusion.
There should be an official Doc where its explained atleast
The text was updated successfully, but these errors were encountered: