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

[BUG] Chrome shows blank page of localhost:5151 and gives error: disallowed MIME type (“text/plain”) after fiftyone app launch, in Windows 10 x64 #2010

Open
xoofee opened this issue Aug 21, 2022 · 13 comments
Labels
app Issues related to App features bug Bug fixes

Comments

@xoofee
Copy link

xoofee commented Aug 21, 2022

System information

Windows 10 21H2 19044.1889 (64bit)
chrome 104.0.5112.102 (64bit)
firefox: 103.0.2 (64bit)
miniconda 4.12.0
Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)]
(all installed from pip)
fiftyone 0.16.5
fiftyone-brain 0.8.2
fiftyone-db 0.3.0
fiftyone-desktop 0.22.1
jupyterlab 3.4.4
ipywidgets 7.7.1

Commands to reproduce

quickstart.py

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart")

if __name__ == "__main__":
    # Ensures that the App processes are safely launched on Windows
    session = fo.launch_app(dataset)
    session.wait()
python quickstart.py

Describe the problem

http://localhost:5151/ shows blank page and give error in console of chrome and firefox, after fiftyone.launch_app in windows.

the errors are:

chrome 104.0.5112.102 (64bit)
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.

firefox: 103.0.2 (64bit)
Loading module from “http://localhost:5151/assets/index.036df8dd.js” was blocked because of a disallowed MIME type (“text/plain”).

Other info / logs

fo.launch_app(dataset, desktop=True) popup the normal fiftyone window.

What areas of FiftyOne does this bug affect?

  • [x ] App: FiftyOne application issue

attachments

blank_and_error_fiftyone
pip list.txt

@xoofee xoofee added the bug Bug fixes label Aug 21, 2022
@xoofee xoofee changed the title chrome shows blank page of localhost:5151 and gives error: disallowed MIME type (“text/plain”) after fiftyone app launch chrome shows blank page of localhost:5151 and gives error: disallowed MIME type (“text/plain”) after fiftyone app launch, in Windows 10 x64 Aug 22, 2022
@brimoor brimoor changed the title chrome shows blank page of localhost:5151 and gives error: disallowed MIME type (“text/plain”) after fiftyone app launch, in Windows 10 x64 [BUG] Chrome shows blank page of localhost:5151 and gives error: disallowed MIME type (“text/plain”) after fiftyone app launch, in Windows 10 x64 Aug 25, 2022
@brimoor brimoor added the app Issues related to App features label Aug 25, 2022
@brianafischer
Copy link

One potential work-around is to use the desktop app:

session = fo.launch_app(dataset, desktop=True)

@dummyindex
Copy link

dummyindex commented Sep 21, 2022

I enconutered the exactly the same issue above.

OS Name Microsoft Windows 10 Pro
Version 10.0.19043 Build 19043
Chrome Version 105.0.5195.127 (Official Build) (64-bit)

conda (pip) packages:
pip_list_cv_general.txt
With the pip list above, desktop version does not work either.

After I upgraded my env with the following cmds

pip install --upgrade pip setuptools wheel
pip install --upgrade fiftyone
pip install --upgrade fiftyone[desktop]

Now desktop works fine, though the web version on my local machine still complains about plain text javascript loading (script tag with type=module).

@benjaminpkane
Copy link
Contributor

Hello all, pardon the delay. We will work on a patch.

Note that this issue can be addressed by ensuring the mimetypes package returns correct types. Some discussion can be found here

@bhavya0598
Copy link

I am facing the same issue and none of the above solutions or workaround worked.
The desktop version is also not working as expected.

@barney2074
Copy link

I'm having the same problem
i.e blank browser, and for the desktop version- nothing happens

@geniusfoever
Copy link

It seems still not fixed

@Ceazy-Gentleman
Copy link

I found a solution for this bug.

@abdulghani91
Copy link

I have the same problem, but the desktop version works for me.

Windows 11
Python 3.9
fiftyone 19.1

@ajaymaity
Copy link

I tried all the above solutions, but none of them worked. It did point me in the right direction and after spending hours on it, I finally figured out the solution. Hoping it would help others too.

You have to change Registry settings for two keys. Open the Registry Editor and

  1. Go to Computer\HKEY_CLASSES_ROOT\.js and change Content Type to application/javascript
  2. Go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js and change Content Type to application/javascript.

Then just restart your shell or jupyter kernel, and the app should start working on localhost. Make sure you force reload the app (Ctrl + Shift + R) to get rid of cached contents.

@JoyLinWQ
Copy link

I tried all the above solutions, but none of them worked. It did point me in the right direction and after spending hours on it, I finally figured out the solution. Hoping it would help others too.

You have to change Registry settings for two keys. Open the Registry Editor and

  1. Go to Computer\HKEY_CLASSES_ROOT\.js and change Content Type to application/javascript
  2. Go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js and change Content Type to application/javascript.

Then just restart your shell or jupyter kernel, and the app should start working on localhost. Make sure you force reload the app (Ctrl + Shift + R) to get rid of cached contents.

Hi @ajaymaity , this is what i see. How do i modify the Content Type?
image

@ajaymaity
Copy link

I tried all the above solutions, but none of them worked. It did point me in the right direction and after spending hours on it, I finally figured out the solution. Hoping it would help others too.
You have to change Registry settings for two keys. Open the Registry Editor and

  1. Go to Computer\HKEY_CLASSES_ROOT\.js and change Content Type to application/javascript
  2. Go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js and change Content Type to application/javascript.

Then just restart your shell or jupyter kernel, and the app should start working on localhost. Make sure you force reload the app (Ctrl + Shift + R) to get rid of cached contents.

Hi @ajaymaity , this is what i see. How do i modify the Content Type? image

Try adding a new key

@JoyLinWQ
Copy link

I tried all the above solutions, but none of them worked. It did point me in the right direction and after spending hours on it, I finally figured out the solution. Hoping it would help others too.
You have to change Registry settings for two keys. Open the Registry Editor and

  1. Go to Computer\HKEY_CLASSES_ROOT\.js and change Content Type to application/javascript
  2. Go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js and change Content Type to application/javascript.

Then just restart your shell or jupyter kernel, and the app should start working on localhost. Make sure you force reload the app (Ctrl + Shift + R) to get rid of cached contents.

Hi @ajaymaity , this is what i see. How do i modify the Content Type? image

Try adding a new key

Thanks for the help. I'm not very familiar with this so please guide me along. I've added new key as shown below and clicked around, the only editable field is "Data", not "Type". May I know if there's anything else i should amend? I've restarted my computer but it seems like the issue is still around (blank page of localhost:5151 saying Not Found. For fiftyone v0.21.6)

For Computer\HKEY_CLASSES_ROOT\.js:
image

For Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.js:
image

@benicamera
Copy link

2. application/javascript

@JoyLinWQ It's not a new key but a new "string value". If you just want to edit, double-click the existing string value name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Issues related to App features bug Bug fixes
Projects
None yet
Development

No branches or pull requests