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 Message If No Backend Installed #1042

Closed
rmorshea opened this issue Jun 12, 2023 · 7 comments · Fixed by #1045
Closed

Better Error Message If No Backend Installed #1042

rmorshea opened this issue Jun 12, 2023 · 7 comments · Fixed by #1045
Labels
flag-good-first-issue A well defined and self-contained task. priority-1-high Should be resolved ASAP. release-patch Warrents a patch release
Milestone

Comments

@rmorshea
Copy link
Collaborator

rmorshea commented Jun 12, 2023

Current Situation

I think a lot of people get confused by this error message:
image

Proposed Actions

We should suggest installing a particular backend in the error message (e.g. pip install reactpy[starlette]).

@rmorshea rmorshea added flag-good-first-issue A well defined and self-contained task. priority-1-high Should be resolved ASAP. release-patch Warrents a patch release labels Jun 12, 2023
@geckguy
Copy link
Contributor

geckguy commented Jun 12, 2023

can i work on this issue?

@Smit-Parmar
Copy link
Contributor

Sure @geckguy
@rmorshea Can you please provide step to reproduce?

@rmorshea
Copy link
Collaborator Author

Sure. This error happens when you haven't installed any of the built-in backends. For example, if you only run pip install reactpy instead of running say, pip install reactpy[starlette]. In the case of the former, when you try and use reactpy.run to execute your application, you'll see the error shown above.

So really, all we need here is a more detailed message that suggests a solution to the problem rather then just saying that we couldn't find an installed backend. The message in question can be found here.

@geckguy
Copy link
Contributor

geckguy commented Jun 12, 2023

Sure. This error happens when you haven't installed any of the built-in backends. For example, if you only run pip install reactpy instead of running say, pip install reactpy[starlette]. In the case of the former, when you try and use reactpy.run to execute your application, you'll see the error shown above.

So really, all we need here is a more detailed message that suggests a solution to the problem rather then just saying that we couldn't find an installed backend. The message in question can be found here.

Okay so in the error message should it suggest possible fixes or should it suggest the exact fix for the problem? for instance possible fix could be to suggest a list of commands that might help them fix the problem

@rmorshea
Copy link
Collaborator Author

Given that the user, having only installed reactpy, probably doesn't care what backend they're using, I think we can specifically suggest that they pip install "reactpy[starlette]". With that said, we can also mention that you can substitute starlette for any of the other supported backends using reactpy.backend.utils.SUPPORTED_PACKAGES .

@rmorshea rmorshea added this to the 1.0.1 milestone Jun 12, 2023
@rmorshea
Copy link
Collaborator Author

If you're able to get this done in the next day or two we can put this out in a 1.0.1 release.

@geckguy
Copy link
Contributor

geckguy commented Jun 12, 2023

Given that the user, having only installed reactpy, probably doesn't care what backend they're using, I think we can specifically suggest that they pip install "reactpy[starlette]". With that said, we can also mention that you can substitute starlette for any of the other supported backends using reactpy.backend.utils.SUPPORTED_PACKAGES .

Got it! i am already on it

geckguy added a commit to geckguy/reactpy that referenced this issue Jun 12, 2023
rmorshea added a commit that referenced this issue Jun 13, 2023
* Better Error message if no backend installed #1042

* change the error message as requested

* Update src/py/reactpy/reactpy/backend/default.py

Co-authored-by: Ryan Morshead <ryan.morshead@gmail.com>

* fix linting issues

* Update src/py/reactpy/reactpy/backend/default.py

Co-authored-by: Ryan Morshead <ryan.morshead@gmail.com>

* Improve readability

* Update src/py/reactpy/reactpy/backend/default.py

* make text bold

---------

Co-authored-by: Ryan Morshead <ryan.morshead@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag-good-first-issue A well defined and self-contained task. priority-1-high Should be resolved ASAP. release-patch Warrents a patch release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants