-
Notifications
You must be signed in to change notification settings - Fork 347
TypeError: unhashable type 'dict' in TemplateResponse causes Internal Server Error on fresh deployment #129
Copy link
Copy link
Open
Description
Environment
- azd version: 1.14+
- Python: 3.13
- Starlette: latest
- Deployment region: eastus
- OS: Windows 11
- Date: March 2026
Description
After successful azd up deployment the app returns Internal Server Error on every page load immediately after deployment. No custom code changes were made.
Root Cause
TemplateResponse syntax in src/api/routes.py line 80 uses the old Starlette argument format which is incompatible with current Starlette version.
Steps to Reproduce
- Fork repo
- Run
azd uptargeting eastus region - Open deployed Container App URL
- Internal Server Error appears immediately
Error Logs
File "/code/api/routes.py", line 80, in index_name
return templates.TemplateResponse(
File "/usr/local/lib/python3.13/site-packages/starlette/templating.py", line 148
template = self.get_template(name)
TypeError: unhashable type: 'dict'
Fix
Change src/api/routes.py line 80 from:
return templates.TemplateResponse(
"index.html",
{
"request": request,
}
)To:
return templates.TemplateResponse(
request=request,
name="index.html"
)Additional Notes
azd upcompletes successfully with all 10 resources created- gpt-4o-mini model deploys successfully
- Error occurs immediately on first page load
- Fix confirmed working after
azd deploy - Chat functionality verified working after fix
- RAG/document upload not tested as requires
separate Azure AI Search configuration
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels