sanic-org / sanic

Accelerate your web app development | Build fast. Run fast.
https://sanic.dev
MIT License
17.86k stars 1.53k forks source link

sanic command line to start the app, developer mode -dev model error #2943

Closed snail-developer closed 1 week ago

snail-developer commented 2 months ago

Is there an existing issue for this?

Describe the bug

I am using Sanic v23.12.1, and when I start the server on my mac, I use developer mode -dev error. The sanic server:app --dev error is IndexError: list assignment index out of range. However, I used sanic server:app --debug --reload to start.

Code snippet

from sanic import Sanic from sanic.response import text

app = Sanic("NMTTranslateApp")

@app.get("/") async def hello_world(request): return text("Hello, world!")

Expected Behavior

No response

How do you run Sanic?

Sanic CLI

Operating System

MacOS

Sanic Version

v23.12.1

Additional context

No response

toasta commented 2 months ago

pip install httpx

works (for me) as a workaround until the check if httpx is available in cli/console.py is fixed. It tries to delete element 3 from a 3 element array (0..2)(variable_descriptions) before logging that httpx is not available. Perhaps that's just an off by one and it should be del variable_descriptions[2]?

ahopkins commented 1 week ago

This should be resolved in the releases next week.