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

Latest version seems broken on windows #256

Open
sam598 opened this issue Jul 29, 2024 · 4 comments
Open

Latest version seems broken on windows #256

sam598 opened this issue Jul 29, 2024 · 4 comments

Comments

@sam598
Copy link

sam598 commented Jul 29, 2024

When installing the latest version of viser through nerfstudio, gsplat, or even building directly from this repository I run into the same error.

:8080/assets/index-DhZhcn5r.js: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.

The server loads, however the webpage appears white.

This doesn't seem to be an issue with 0.2.0 or earlier.

@brentyi
Copy link
Collaborator

brentyi commented Jul 30, 2024

Hello, thanks so much for reporting!

To clarify:

  • Does this happen even when you install via pip?
  • Is this reproducible across different web browsers? Would you be able to share which one you're using?

We have some folks at Berkeley who've been using Windows and haven't had problems, and I'm also not aware of any changes that would impact this. But I can try to fix if we're able to reproduce it.

@sam598
Copy link
Author

sam598 commented Jul 30, 2024

I'm using chrome on windows.

It happens when installing from pip, or the latest version of nerfstudio from source. Installing nerfstudio from pip seems to install a much older version of viser. I had to directly call pip install viser==0.2.0 to get it to work with gsplat 1.1.1

@brentyi
Copy link
Collaborator

brentyi commented Jul 30, 2024

I installed Parallels to check in Windows and wasn't able to reproduce in Chrome or Edge with Python 3.10~3.12.

Looking at the code it also doesn't seem like anything has changed that would cause the MIME type to break (this is how it's determined), so I unfortunately don't have a fix... if you have any other information for reproducing that could also be helpful.

@quentin-dietz
Copy link

@sam598 we figured out that this is caused by the windows registry not having a content type definition for .js file type, other users report the same issue.. We fixed it by modifying the code here to read as follows:

mime_type = mimetypes.guess_type(relpath)[0]
if mime_type is None:
    mime_type = "application/octet-stream"
### FIX WINDOWS REGISTRY MIME TYPE ISSUE
if relpath.endswith(".js"):
    mime_type = "application/javascript"
response_headers = {
    "Content-Type": mime_type,
}

@brentyi brentyi mentioned this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants