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

Unable to load the mesop app in my browser #441

Closed
abhishek085 opened this issue Jun 16, 2024 · 8 comments
Closed

Unable to load the mesop app in my browser #441

abhishek085 opened this issue Jun 16, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@abhishek085
Copy link

Bug: Unable to load the Mesop App in my browser . It is stuck as Loading in the window.

Steps to reproduce the behavior:

Using VScode run the below simple hello_world.py from the mesop sample.
import mesop as me

@me.page()
def app():
me.text("Hello World")

Screenshots
image

Desktop System Info

  • OS: Windows
  • Browser : Chrome, Edge

The app is running and hot reloading and everything works fine. I am not able to load the UI in the browser.

@abhishek085 abhishek085 added the bug Something isn't working label Jun 16, 2024
@wwwillchen
Copy link
Collaborator

Can you open Chrome DevTools and paste your console log messages, especially any errors?

@abhishek085
Copy link
Author

Getting these two errors:
Refused to execute script from 'http://localhost:32123/zone.js/bundles/zone.umd.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

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.

maybe due to : web server isn't correctly identifying the zone.umd.js file as a JavaScript file

@wwwillchen
Copy link
Collaborator

Looks like a similar issue as #463. Could you follow the steps in #463 (comment) and let me know what you get? Thanks.

@wwwillchen
Copy link
Collaborator

Also, just checking how are you installing Mesop? If you're not using a virtual environment, please follow these steps: https://google.github.io/mesop/getting_started/installing/#create-a-venv-environment

@gamesbyjames
Copy link

gamesbyjames commented Jun 23, 2024

same issue, followed the venv instructions from the getting-started guide. Just see "Loading..." with these errors in the browser console:

The resource from “http://localhost:32123/zone.js/bundles/zone.umd.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
Content-Security-Policy: The page’s settings blocked an inline script (script-src-elem) from being executed because it violates the following directive: “script-src 'self' 'nonce-...'”
The resource from “http://localhost:32123/zone.js/bundles/zone.umd.js” was blocked due to MIME type (“text/plain”) mismatch (X-Content-Type-Options: nosniff).
Loading failed for the <script> with source “http://localhost:32123/zone.js/bundles/zone.umd.js”.
Loading module from “http://localhost:32123/editor_bundle/bundle.js” was blocked because of a disallowed MIME type (“text/plain”).
Loading failed for the module with source “http://localhost:32123/editor_bundle/bundle.js”

@GTimothee
Copy link

GTimothee commented Jun 24, 2024

@wwwillchen
Copy link
Collaborator

Thanks @GTimothee for the pointer, I think I've fixed it in #532 and have cut a new release v0.9.2.

Please the latest version and let me know if it's fixed the issue : pip install --upgrade mesop

Thanks!

@abhishek085
Copy link
Author

Thanks, After the update its working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants