Open tclasen opened 2 years ago
Same here
File ".venv/lib/python3.10/site-packages/fastapi_vite/loader.py", line 10, in <module>
from jinja2 import Markup
ImportError: cannot import name 'Markup' from 'jinja2' (.venv/lib/python3.10/site-packages/jinja2/__init__.py)
What I did as a workaround to make it work is to change fastapi_vite/loader.py
replacing this line
from jinja2 import Markup
with
from markupsafe import Markup
@paolodina , did you fork this repo or monkey patch it during loading? If you have an example FastAPI project successfully using this library I would love to see it and try it out.
This one fixed the issue for me https://github.com/paolodina/fastapi-vite/tree/temporary-import-fix. Btw, my branch is not at the latest commit (which, tbh I wasn't even able to install).
I still have to try if it "really works", but at least the server starts without raising the exception.
PS.
If you have an example FastAPI project successfully using this library I would love to see it and try it out.
btw I almost forgot to ask the same just in case.
Hey, all - Sorry that I haven't actively kept this up to date. I have been using this in another larger project and have (very slowly) been peeling it out into it's own package.
I'll publish a full sample project that uses this. I also plan to clean up a few things and finish integrating the Vite Runner process.
Are there any other specific issues you guys are still having?
I tried this out and wasn't able to get it working, either by using the example in the readme, and the sample in the repo itself. Neither worked for me.