Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Failed to load module script #182

Closed
captainsikay opened this issue Sep 26, 2019 · 5 comments · Fixed by #206
Closed

Failed to load module script #182

captainsikay opened this issue Sep 26, 2019 · 5 comments · Fixed by #206
Labels
note:fixed? It should've been fixed, waiting for response

Comments

@captainsikay
Copy link

While trying to start the UI with the serve command I get the following error in the files

  • "base.js:1"
  • "home.js:1",
  • "setting.js:1"
  • "dialog.js:1"

Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.

The login works fine, after that I get a blank page with only the logout button.

I use Windows 10 with latest chrome (also tried latest firefox) and latest version (as of 26th September) of shiori-windows-amd64.exe from the releases page.

@RadhiFadlillah
Copy link
Collaborator

@captainsikay sorry for late reply.

Unfortunately I can't seem to reproduce it. I've tested it in Firefox 69 in Manjaro and Windows, also in Chrome 77 and Firefox 69 in Windows.

One of possible reason for this issue is the browser did MIME sniffing on its own, which in some case will mark the JS file as plain text. To fix this, I've added X-Content-Type-Options: nosniff header which will prevent the browser setting content type on its own.

If you don'y mind, could you check it out ? Thanks !

@RadhiFadlillah RadhiFadlillah added the note:fixed? It should've been fixed, waiting for response label Oct 4, 2019
@cocoastorm
Copy link
Contributor

Hey, I'm getting hit by this too. I believe what's happening on Windows is that the mimeType being returned is plain/text, which prevents scripts from being executed because of the wrong mimeType.

A quick Google search shows another Github repo getting hit by this (back in 2018): labstack/echo#1038 (comment)

Especially in their comment it seems that Windows returns plain/text in their testing.

I believe this is where the mimeType is being set

Very odd lol. I'll try to test with a newer version of Golang.

@lalitkale
Copy link

I am facing this issue again. I downloaded the binary "shiori-windows-amd64.exe" for v1.5.0 on Windows 10 and just fired "shiori serve" and getting blank page with
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec error in browser console for 'base.js', 'home.js', 'settings.js' and 'dialog.js'.
go version go1.13.5 windows/amd64

@sjbr
Copy link

sjbr commented Aug 13, 2020

I have this problem in chrome and firefox on windows

@phanirithvij
Copy link

phanirithvij commented Sep 26, 2021

Still have this problem, when installed from master. Via go get and go install

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
note:fixed? It should've been fixed, waiting for response
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants