0

I have a working python 3.9 Flask app. The latest Pycharm is my IDE. Yesterday I created a new app with a very similar structure. The old app runs and finds/loads all static content just as expected when run through the PyCharm debugger or from the command line with flask run.

The new app will "run" from PyCharm or flask run. It loads the main/home blueprint and serves the correct template. What it does not do is serve any css or js resources in the static folder. Rather, it tries to load them but each resource in the Brave developer tools window has the message:

Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH

I have surveyed the file sizes for each css and js file. I have matched the lengths against the developer tools "network" tab response information and it looks like all the sizes match.

I have tried this with FireFox and it just says:

Loading failed for the <script> with source “http://127.0.0.1:5000/static/LIB/jquery/jquery.min.js”.

and the other resources.

I have deleted and recreated the node_modules and the .idea dirs.

Ideas?

7 Reeds
  • 2,419
  • 3
  • 32
  • 64

1 Answers1

0

Sigh, my problem was with setting the USE_X_SENDFILE Flask config variable. The dev server does not support it and honestly I don't know why I even included it. Removing it fixed my issues.

Thanks entirely to this post: Flask development server with X-Sendfile

7 Reeds
  • 2,419
  • 3
  • 32
  • 64