-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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
Flask failing to startup due to Jinja2 breaking change #4494
Comments
Noticed that flask 2.0.x doesn't have this issue, but may want to backfix if Flask 1.1.x is still being supported with patch fixes |
You are using an unsupported version of Flask, please update to the latest version if possible. Additionally, please use a tool like pip-tools to pin your dependencies and control when you get updates. Be sure to run your tests with deprecation warnings treated as errors so that you get notified of these types of changes early. |
@davidism how do you use pip-tools to pin the version? |
When installing your dependencies you just specify them without versions (in requirements.in) and then use Then those version numbers will stay until you do an explicit (When doing all this after the fact (ie now) you'll of course have a harder time because now you aren't at a point in time where you can't just use "latest version of everything" and not encounter problems.) |
How can we keep using Flask==1.1.1? We have an entire app built on it that will take a significant time to refac for Flask 2.x. |
As someone maintaining a large Flask-based project, I don't think it will take you a "significant time" to make it compatible with Flask 2.0, unless you are still on Python 2.7 of course.. Anyway, just pin Flask's transitive dependencies to older versions that still work... |
How can I pin it to Jinja2==3.0.3? This is something that happens under the hood when Flask installs via requirements.txt into a docker container. To be specific, the error is coming from
|
You need to add it as an explicit dependency |
I have done that, and it does not work, see reqs.txt here:
|
it works for me
Pip uninstall packages, then re-install worked for me |
after pinning Jinja2 to 3.0.3, there encounter another error..
and my requirements.txt is
|
Jinja2==3.0.3 |
I ran into the exact same error today, does anyone know what is causing this issue? |
using the above mentioned library versions did resolve this issue, but I am just curious as to what caused this error in the first palce |
You are using an outdated version of Flask, and newer versions of Werkzeug have changed in a way that breaks compatibility with that version. In the future, please ask for help in the Discussions or the Pallets Discord |
removed markupsafe pinned and added Jinja2 to resolve build error due to pallets/flask#4494 Flask failing to startup due to Jinja2 breaking change
removed markupsafe pinned and added Jinja2 to resolve build error due to pallets/flask#4494 Flask failing to startup due to Jinja2 breaking change
You really aren't, as that has changed in the latest version. Please ask for further help in the Discord or discussions on this repo. |
This issue tracker is a tool to address bugs in Flask itself. Please use
Pallets Discord or Stack Overflow for questions about your own code.
Since Jinja2 version 3.1.0 was released yesterday, Flask is failing to startup.
Describe how to replicate the bug.
Run a basic flask app, it fails to start up with the following traceback:
Describe the expected behavior that should have happened but didn't.
Application starts up successfully.
Pinning Jinja to 3.0.3 bypasses this issue for us for now, but there's a breaking change there somewhere that will need to be fixed in Flask itself.
Environment:
The text was updated successfully, but these errors were encountered: