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

Module scripts fail to load #294

Closed
NickAcPT opened this issue Jan 3, 2022 · 8 comments
Closed

Module scripts fail to load #294

NickAcPT opened this issue Jan 3, 2022 · 8 comments
Labels
bug Something isn't working prio a upstream

Comments

@NickAcPT
Copy link
Contributor

NickAcPT commented Jan 3, 2022

Describe the bug
A clear and concise description of what the bug is. Please briefly describe how to reproduce the bug as well as expected vs. actual behavior. Optionally include screenshots and server logs, if helpful.

When accessing the dashboard, nothing loads.

Checking the devtools console, I was able to find the following.

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. menu-main.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.

System information
Please provide information on:

  • Wakapi version: 2.0.0 RC1
  • Operating system: Windows 10 Version 20H2 (Build 19042.1415)
    • Windows 10 20H2
  • Browser: Google Chrome 96.0.4664.110 (Official Build) (64-bit) (cohort: Stable)
  • Database: SQLite
  • Accessing through localhost
@YC
Copy link
Collaborator

YC commented Jan 3, 2022

I've download the latest release and it seems to be fine.
Screenshot_2022-01-03_14-44-29
OS: Windows 21H1 19043.1415

Can you please give context about how you're building/running wakapi?
e.g. Compiled from repo (with/without docker), downloaded release zip etc.

@NickAcPT
Copy link
Contributor Author

NickAcPT commented Jan 3, 2022

I've download the latest release and it seems to be fine. Screenshot_2022-01-03_14-44-29 OS: Windows 21H1 19043.1415

Can you please give context about how you're building/running wakapi? e.g. Compiled from repo (with/without docker), downloaded release zip etc.

@YC Oh, that's odd. I downloaded the windows version from this release.
I have migrated from an old version (not too old either) to this one and this started happening.
Regarding running wakapi, i'm just running it from the command line. Here's my configuration file just in case.

@muety
Copy link
Owner

muety commented Jan 3, 2022

Regarding running wakapi, i'm just running it from the command line. Here's my configuration file just in case.

Should be fine, that's what I usually do as well.

I remember that I once came across the same error message during development, but can't remember how I got it fixed. The weird thing is that it works on my machine (and @YC's). Do you get the same error when browing to https://wakapi.dev/signup?

I'm not a JS pro, but this might be relevant: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#aside_%E2%80%94_.mjs_versus_.js. However, I don't see a reason why content type should be wrong, as the module files are named .js like any others. And, again, it works for some people at least.

Could you post a screenshot of your browser tools' network tab, with a focus on the menu-main.js file request?

@muety muety added bug Something isn't working prio a labels Jan 3, 2022
@NickAcPT
Copy link
Contributor Author

NickAcPT commented Jan 3, 2022

Regarding running wakapi, i'm just running it from the command line. Here's my configuration file just in case.

Should be fine, that's what I usually do as well.

I remember that I once came across the same error message during development, but can't remember how I got it fixed. The weird thing is that it works on my machine (and @YC's). Do you get the same error when browing to wakapi.dev/signup?

I'm not a JS pro, but this might be relevant: developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#aside_%E2%80%94_.mjs_versus_.js. However, I don't see a reason why content type should be wrong, as the module files are named .js like any others. And, again, it works for some people at least.

Could you post a screenshot of your browser tools' network tab, with a focus on the menu-main.js file request?

@muety Hello there, thanks for the fast reply!

Yesterday, when I made this issue, the dashboard data, wasn't even loading. Today, it loads the data, but the menu is still broken + the summary stuff.

Regarding the dev tools screenshot, here's what it's showing:
image
image2

Oddly enough, the js files still are being sent as text/plain.

@muety
Copy link
Owner

muety commented Jan 3, 2022

I did some more research and found your exact problem here: golang/go#32350. Super interesting discussion there! It actually goes all the way down to your Windows registry. Interestingly, the issue does not occur on my Windows 10 setup, so it looks like some software, that you have installed on your system, once changed that registry entry.

A workaround is mentioned here: golang/go#32350 (comment). I'd recommend to apply that to your system as a quick fix and in addition wait for the Go team to perhaps come up with a permament fix. I think there's not much we can do on Wakapi's side. Let me know if that worked for you!

Edit: It's also intersting to see that for me, the content type is application/javascript on Linux and text/javascript on Win.

@muety muety added the upstream label Jan 3, 2022
@andre-paulo98
Copy link

andre-paulo98 commented Jan 3, 2022

I tested this as well, works fine if I use Docker Installation (Option 3: Use Docker), but I get the same error if I use "Option 2: Quick-run a Release" on Windows 10.

I noticed that the default docker is running on 1.30.3, where the Quick-run a Release is running 2.0.0 RC1

@NickAcPT
Copy link
Contributor Author

NickAcPT commented Jan 3, 2022

I did some more research and found your exact problem here: golang/go#32350. Super interesting discussion there! It actually goes all the way down to your Windows registry. Interestingly, the issue does not occur on my Windows 10 setup, so it looks like some software, that you have installed on your system, once changed that registry entry.

A workaround is mentioned here: golang/go#32350 (comment). I'd recommend to apply that to your system as a quick fix and in addition wait for the Go team to perhaps come up with a permament fix. I think there's not much we can do on Wakapi's side. Let me know if that worked for you!

Edit: It's also intersting to see that for me, the content type is application/javascript on Linux and text/javascript on Win.

@muety Awesome discovery! Never would've thought that Microsoft's insanity would break local servers.

The workaround you mentioned solved the issue locally! Still would be good to have the go team upstream fix it.
(EDIT: Didn't mean to close the issue)

@andre-paulo98 I saw your comment and I recommend also running the fix mentioned by muety

@NickAcPT NickAcPT closed this as completed Jan 3, 2022
@NickAcPT NickAcPT reopened this Jan 3, 2022
@muety
Copy link
Owner

muety commented Jan 3, 2022

I'm glad the fix worked. I'll close this issue as there's nothing more we can do on our side. Susbcribe to changes of the upstream issue to track progress.

@muety muety closed this as completed Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prio a upstream
Projects
None yet
Development

No branches or pull requests

4 participants