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

Add warning for use of session store outside of a component #5176

Closed
ghostdevv opened this issue Jun 7, 2022 · 1 comment
Closed

Add warning for use of session store outside of a component #5176

ghostdevv opened this issue Jun 7, 2022 · 1 comment
Labels
p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc.

Comments

@ghostdevv
Copy link
Member

Describe the problem

You are unable to use the session store outside of a component and currently you just get an error message along the lines of Function called outside component initialisation

Describe the proposed solution

Talked in the discord about potentially adding something to svelte core to allow you to check whether you are in component initialisation or not and then libs can use that to throw more helpful error messages

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

@dummdidumm dummdidumm added the p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc. label Jul 19, 2022
@rmunn
Copy link
Contributor

rmunn commented Aug 17, 2022

This is probably moot now that #5946 has removed the special $session store. (It can now be implemented quite easily by anyone who needs it, using event.locals and a +layout.server.ts file). So I'm closing the issue; if the decision to remove the session store gets reversed, we can reopen the issue if/when that happens.

@rmunn rmunn closed this as completed Aug 17, 2022
@rmunn rmunn mentioned this issue Aug 17, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Projects
None yet
Development

No branches or pull requests

3 participants