locust
locust copied to clipboard
cannot open dashboard and console error shows 'the server responded with a MIME type of "text/plain".'
Prerequisites
- [X] I am using the latest version of Locust
- [X] I am reporting a bug, not asking a question
Description
i'm newbie and trying the hellow world from doc
PS C:\Users\LeiYang> D:\pv\loc\Scripts\Activate.ps1
(loc) PS C:\Users\LeiYang> locust -V
locust 2.24.0 from d:\pv\loc\lib\site-packages\locust (python 3.8.3)
(loc) PS C:\Users\LeiYang> cd D:\G\lucust-learn
(loc) PS D:\G\lucust-learn> locust -f .\demo.py
[2024-03-13 22:41:04,777] DESKTOP-1SLBP5D/WARNING/locust.main: Python 3.8 support is deprecated and will be removed soon
[2024-03-13 22:41:04,777] DESKTOP-1SLBP5D/INFO/locust.main: Starting web interface at http://localhost:8089 (accepting connections from all network interfaces)
[2024-03-13 22:41:04,816] DESKTOP-1SLBP5D/INFO/locust.main: Starting Locust 2.24.0
then i open above web page using either edge or chrome, both blank page, and console error is
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
Command line
locust -f .\demo.py
Locustfile contents
from locust import HttpUser, task
class HelloWorldUser(HttpUser):
@task
def hello_world(self):
self.client.get("/hello")
self.client.get("/world")
Python version
3.8
Locust version
2.24.0
Operating system
windows 11
I encountered the same issue and wanted to share a temporary workaround. By switching to Windows Subsystem for Linux (WSL), I was able to bypass the problem for the time being. Additionally, I discovered that installing an older version of the package resolved the issue on my end. If anyone else is looking for a temporary fix, you might want to try installing version 2.18.4 of Locust using the following command:
pip install locust==2.18.4
I hope this helps others facing the same problem until a permanent solution is found.
I encountered the same issue and wanted to share a temporary workaround. By switching to Windows Subsystem for Linux (WSL), I was able to bypass the problem for the time being. Additionally, I discovered that installing an older version of the package resolved the issue on my end. If anyone else is looking for a temporary fix, you might want to try installing version 2.18.4 of Locust using the following command:
pip install locust==2.18.4
I hope this helps others facing the same problem until a permanent solution is found.
thanks, indeed this version can show the page.
though it says Starting web interface at http://0.0.0.0:8089
and i can only access by http://localhost:8089
@andrewbaldwin44 Can you take a look?
Instead of running an old version of locust as a workaround, you can probably just add --legacy-ui
@LeiYangGH Could you please share what browser and version you are using?
chrome 122.0.6261.113(32 bit)
edge 123.0.2420.32 stable,beta channel (64 bit)
@andrewbaldwin44 Can you take a look?
Instead of running an old version of locust as a workaround, you can probably just add
--legacy-ui
confirm this is working!
@LeiYangGH I just got the chance to try this on Windows 11. I have Python 3.12 and I am able to view the dashboard on both Edge and Chrome
This issue was closed because it has been stalled for 10 days with no activity. This does not necessarily mean that the issue is bad, but it most likely means that nobody is willing to take the time to fix it. If you have found Locust useful, then consider contributing a fix yourself!