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

better error when using read with adapter-auto #11684

Closed
Rich-Harris opened this issue Jan 19, 2024 · 0 comments · Fixed by #11689
Closed

better error when using read with adapter-auto #11684

Rich-Harris opened this issue Jan 19, 2024 · 0 comments · Fixed by #11689

Comments

@Rich-Harris
Copy link
Member

Rich-Harris commented Jan 19, 2024

Describe the problem

If someone uses the new read function in a default project, it will fail immediately with the following error:

Cannot use read from $app/server in when using @sveltejs/adapter-auto. Please ensure that your adapter is up to date and supports this feature.

This could be more helpful

Describe the proposed solution

Add a supports.read function to adapter-auto that throws a more helpful error. Something like

The read function imported from $app/server only works in certain environments. Since you're using @sveltejs/adapter-auto, SvelteKit cannot determine whether it will work when your app is deployed. Please replace it with an adapter tailored to your target environment.

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

Successfully merging a pull request may close this issue.

1 participant