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

Bug: Litestar instance or factory not found #3451

Open
glickums opened this issue Apr 29, 2024 · 1 comment
Open

Bug: Litestar instance or factory not found #3451

glickums opened this issue Apr 29, 2024 · 1 comment
Labels
Bug 🐛 This is something that is not working as expected Needs MCVE This needs an MCVE

Comments

@glickums
Copy link

glickums commented Apr 29, 2024

Hi, every time I try to run litestar from vscode I get a "Could not find Litestar instance or factory"


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@JacobCoffee JacobCoffee changed the title Error Bug: Litestar instance or factory not found Apr 29, 2024
@JacobCoffee JacobCoffee added Bug 🐛 This is something that is not working as expected Needs MCVE This needs an MCVE labels Apr 29, 2024
@JacobCoffee
Copy link
Member

JacobCoffee commented Apr 29, 2024

Can you provide an MCVE of your project structure? You can see how Litestar discovers things in https://docs.litestar.dev/latest/usage/cli.html#autodiscovery, and you error indicates those criteria are not met.

If it is not in your current directory, or discoverable otherwise as listed in the documentation, you have to provide the path via something like:

litestar --app-dir "/Users/jacob/Library/Application Support/JetBrains/PyCharm2023.3/scratches/" run

or

litestar --app module.path.to.examples.basic:app run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 This is something that is not working as expected Needs MCVE This needs an MCVE
Projects
None yet
Development

No branches or pull requests

2 participants