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

Question: exclude async components from init load #110

Open
Kolobok12309 opened this issue Aug 5, 2021 · 2 comments
Open

Question: exclude async components from init load #110

Kolobok12309 opened this issue Aug 5, 2021 · 2 comments

Comments

@Kolobok12309
Copy link

I use this package and it worked well with hydration and async componnets. But can i exclude some async components, from initial html scripts? I have NavBar with some only mobile and only desktop elements, but nuxt load all of them(hydration work as expected)

@Kolobok12309
Copy link
Author

Reproduce
Code
Page

If you go to page link, you can see script /_nuxt/tutorial-lazy.js in ssr html, but component async
I know that vue-lazy-hydration not call it, check it in console.
For some components it work as expected(load only when trigger hydration)

@paulnta
Copy link

paulnta commented Sep 9, 2021

This issue is more related to vue-server-renderer which Nuxt.js depends on. If an async script is used on the server when rendering the page, vue-server-renderer will automatically inject it into the HTML.

So you are looking for a way to tell vue-server-renderer to not automatically render some async scripts. This is being disscussed (since a long time 😄 ) in this issue and this PR

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

No branches or pull requests

2 participants