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 report]rendering exceptions when using teleport #127

Open
yyyanghj opened this issue May 2, 2021 · 2 comments
Open

[Bug report]rendering exceptions when using teleport #127

yyyanghj opened this issue May 2, 2021 · 2 comments

Comments

@yyyanghj
Copy link

yyyanghj commented May 2, 2021

Bug report

Description

I have a <Wrapper /> component, which is used in every layout component. If I use <teleport/> in <Wrapper/>, something weird will happen. When I navigate to /about, everything is gone and the whole Vue App is destroyed.

Steps to reproduce

Reproduction link / repo: https://github.com/yyyang1996/for-vuepress-issue-1

  1. Clone this repo.
  2. Build and serve.
yarn install
yarn build
yarn serve
  1. Open http://localhost:5050

vupress-3

  1. Click the button then you link to /about.
  2. The content lost and the whole Vue App is destroyed.

Screenshots

vuepress-1

Expected behavior

vuepress-2

Environment info

  • Browser: Microsoft Edge 90.0.818.46
  • Vuepress version: 2.0.0-beta.12
@meteorlxy
Copy link
Member

And the behavior is different in dev and build:

image

image


🤔 Need some investigation

@meteorlxy meteorlxy added the bug Something isn't working label May 26, 2021
@meteorlxy
Copy link
Member

meteorlxy commented May 26, 2021

I think the issue is that we need to handle teleport SSR first:

https://github.com/vuejs/vue-next/blob/201060717d4498b4b7933bf8a8513866ab9347e4/packages/server-renderer/__tests__/ssrTeleport.spec.ts#L28-L29

I had ever put a TODO comment, but removed it in a later commit:

https://github.com/vuepress/vuepress-next/blob/9b4a2cd3bc5af63085ee4850215948268f5b8f92/packages/%40vuepress/bundler-webpack/src/build/renderPage.ts#L103

As far as I know, there is currently no good solution for teleport SSR yet. The SSR outlet of teleport is simply <!--teleport-start--><!--teleport-end-->, which does not provide any information about the ordering.

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

No branches or pull requests

2 participants