fiftyone icon indicating copy to clipboard operation
fiftyone copied to clipboard

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

Open xoofee opened this issue 2 years ago • 13 comments

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 avatar Aug 21 '22 01:08 xoofee

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

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

brianafischer avatar Aug 31 '22 21:08 brianafischer

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).

dummyindex avatar Sep 21 '22 01:09 dummyindex

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

benjaminpkane avatar Sep 21 '22 02:09 benjaminpkane

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

bhavya0598 avatar Oct 11 '22 22:10 bhavya0598

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

barney2074 avatar Jan 04 '23 07:01 barney2074

It seems still not fixed

geniusfoever avatar Jan 14 '23 12:01 geniusfoever

I found a solution for this bug.

Ceazy-Gentleman avatar Feb 03 '23 19:02 Ceazy-Gentleman

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

Windows 11 Python 3.9 fiftyone 19.1

abdulghani91 avatar Mar 06 '23 09:03 abdulghani91

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.

ajaymaity avatar Mar 07 '23 10:03 ajaymaity

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

JoyLinWQ avatar Aug 17 '23 07:08 JoyLinWQ

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

ajaymaity avatar Aug 17 '23 10:08 ajaymaity

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

JoyLinWQ avatar Aug 17 '23 12:08 JoyLinWQ

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.

benicamera avatar Jan 29 '24 12:01 benicamera