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

get_store_value() called twice in SSR mode #3375

Closed
tivac opened this issue Aug 8, 2019 · 1 comment · Fixed by #5419
Closed

get_store_value() called twice in SSR mode #3375

tivac opened this issue Aug 8, 2019 · 1 comment · Fixed by #5419
Labels

Comments

@tivac
Copy link
Contributor

tivac commented Aug 8, 2019

Describe the bug
I was playing around with trying to repro a bug I'm seeing in SSR mode and happened to notice something weird in the output. Not critical, mind you, but still probably worth fixing?

To Reproduce
REPL repro

Open that REPL link, switch to the "JS Output" tab, and switch from DOM to SSR mode to see the issue.

const App = create_ssr_component(($$result, $$props, $$bindings, $$slots) => {
	let $style;

	let style = readable("foo"); $style = get_store_value(style);

	$style = get_store_value(style);

	return `${escape($style)}`;
});

Expected behavior
I don't think $style = get_store_value(style); should be output twice.

Information about your Svelte project:

  • Svelte 3.7.1

Severity
Not very

@Conduitry
Copy link
Member

This is finally fixed in 3.31.2 as part of a more sweeping change to how store autosubscriptions are handled in SSR code. See the generated code for https://svelte.dev/repl/d330749826a643cca26d557d1983a623?version=3.31.2

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

Successfully merging a pull request may close this issue.

3 participants