pallets / flask

The Python micro framework for building web applications.
https://flask.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
67.5k stars 16.14k forks source link

Encountering Jinja2 SyntaxError after adding another css file #5530

Closed K0sh1R1zumu closed 1 month ago

K0sh1R1zumu commented 1 month ago

I've been encountering this confusing error; which is Jinja2.exceptions.TemplateSyntaxError: expected token ',', got 'string'. This only happened after I added another css file to my html script. But previously, it worked fine.

Here are the previous errors i've encountered regarding this issue:

<link rel="icon" href="{{ url_for('static', filename='images/favicon.png') }}">
jinja2.exceptions.TemplateSyntaxError: expected token ',', got 'static'
    <li onclick="redirectUser('/homepage')">Home</li>
jinja2.exceptions.TemplateSyntaxError: expected token ',', got 'string'

Environment:

ThiefMaster commented 1 month ago

Show the full template. Also double-check that you don't have e.g. typographical quotes instead of the standard '. Maybe you didn't properly close some previous Jinja tag?