You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
😒 I knew there was bound to be some bug with such sweeping changes. I will work on a patch for this and get a 21.3.1 out as soon as I can. We need to add this to test coverage as well.
Describe the bug
After upgrading from 20.12.3 to 21.3.0 I'm getting 404 for all my static files (those files are located inside subfolders), example:
GET http://127.0.0.1:8000/static/node_modules/jquery/dist/jquery.min.js 404
but static files that are located directly inside static folder are accessible, example:
GET http://127.0.0.1:8000/static/package.json 200
Code snippet
I added static in this way (it was working fine for Sanic <= 20.12.3):
app.static("/static", "./static")
I'm assuming the problem is in this line:
uri += "/<__file_uri__>"
https://github.com/sanic-org/sanic/blob/master/sanic/mixins/routes.py#L779
looks like there is no place for subfolders
Expected behavior
I expect static files inside subfolders to accessible.
Environment (please complete the following information):
Additional context
This is a problem only for local environment, for prod static files are not served by Sanic
The text was updated successfully, but these errors were encountered: