Skip to content
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

cannot open dashboard and console error shows 'the server responded with a MIME type of "text/plain".' #2633

Open
2 tasks done
LeiYangGH opened this issue Mar 13, 2024 · 7 comments
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it

Comments

@LeiYangGH
Copy link

Prerequisites

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

@LeiYangGH LeiYangGH added the bug label Mar 13, 2024
@Sh1co
Copy link

Sh1co commented Mar 13, 2024

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.

@LeiYangGH
Copy link
Author

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

@cyberw
Copy link
Collaborator

cyberw commented Mar 14, 2024

@andrewbaldwin44 Can you take a look?

Instead of running an old version of locust as a workaround, you can probably just add --legacy-ui

@andrewbaldwin44
Copy link
Collaborator

@LeiYangGH Could you please share what browser and version you are using?

@LeiYangGH
Copy link
Author

chrome 122.0.6261.113(32 bit)

edge 123.0.2420.32 stable,beta channel (64 bit)

@LeiYangGH
Copy link
Author

@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!

@cyberw cyberw added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label May 10, 2024
@andrewbaldwin44
Copy link
Collaborator

@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
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it
Projects
None yet
Development

No branches or pull requests

4 participants