sveltejs / svelte

web development for the rest of us
https://svelte.dev
MIT License
79.81k stars 4.24k forks source link

Svelte client and server components render text nodes differently #6135

Closed asv7c2 closed 1 week ago

asv7c2 commented 3 years ago

Describe the bug Text is moving up down

To Reproduce Repo

Expected behavior Text must not moving.

Information about your SvelteKit Installation:

Severity How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of SvelteKit entirely?

Note: the more honest and specific you are here the more we will take you seriously.

Additional context Add any other context about the problem here.

benmccann commented 3 years ago

before Screenshot from 2021-03-26 21-26-39

after Screenshot from 2021-03-26 21-26-40

You can fix this by putting {text1} and {text2} on the same line. If you change {text1} to text1 the text stops moving as well. I think that SSR and CSR render the text nodes slightly differently. This will be easier to investigate once SvelteKit has the ability to variously toggle CSR vs SSR

asv7c2 commented 3 years ago

@benmccann If replace text nodes to:

<div>{text1}</div>
<div>{text2}</div>

text moving too. I think it not related to text nodes only.

Looks like break new lines are removed after ssr.

asv7c2 commented 3 years ago

@benmccann Maybe just disable ssr during dev?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dummdidumm commented 1 week ago

Closing as inactive, with the reproducible no longer available. This may have been fixed in Svelte 5