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

locust/webui/dist/index.html script errors. #2753

Closed
2 tasks done
spatel-glsauto opened this issue Jun 7, 2024 · 7 comments · Fixed by #2759
Closed
2 tasks done

locust/webui/dist/index.html script errors. #2753

spatel-glsauto opened this issue Jun 7, 2024 · 7 comments · Fixed by #2759
Labels

Comments

@spatel-glsauto
Copy link

spatel-glsauto commented Jun 7, 2024

Prerequisites

Description

I'm on version 2.28.0. When I run locust.exe, I open up localhost:8089 in chrome. The page appears blank. Opening developer tools, I saw the following:

  1. 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.
    a. Modifying the mime type from "module" to "application/javascript" fixed this error.

  2. Minified React error Inconsistent stats resetting #299; visit https://reactjs.org/docs/error-decoder.html?invariant=299
    a. Moving the first script tag out of <head> to right after the inline script fixed this error.

Command line

locust.exe

Locustfile contents

from locust import HttpUser, task
class HelloWorldUser(HttpUser):
    @task
    def hello_world(self):
        self.client.get("about:blank/")

Python version

3.10.11

Locust version

2.28.0

Operating system

Microsoft Windows 10 Enterprise

@spatel-glsauto spatel-glsauto changed the title locust/webui/dist/index.html script errrors. locust/webui/dist/index.html script errors. Jun 7, 2024
@cyberw
Copy link
Collaborator

cyberw commented Jun 7, 2024

Hi @spatel-glsauto ! Can you try opening it in private mode to ensure it is not related to your browser? Do you have any extensions installed? Is there anything in Locust's log?

@spatel-glsauto
Copy link
Author

spatel-glsauto commented Jun 7, 2024 via email

@spatel-glsauto
Copy link
Author

Attached the image files that didn't get copied from the email reply:
Code edit that makes the browser work:
code_edit

Browser executed in incognito mode:
browser

The requested locust logs:
locust.log

@cyberw
Copy link
Collaborator

cyberw commented Jun 7, 2024

@andrewbaldwin44 Can you have a look?

@andrewbaldwin44
Copy link
Collaborator

andrewbaldwin44 commented Jun 10, 2024

Some digging on Stackoverflow revealed that it may be a Windows issue

We've pushed a fix, let us know if this fixes your issue!

@andrewbaldwin44
Copy link
Collaborator

Duplicates #2633

@cyberw
Copy link
Collaborator

cyberw commented Jun 10, 2024

@spatel-glsauto can you re-test with latest and greatest to see if your issue is resolved? (pip install -U --pre locust)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants