Giter VIP home page Giter VIP logo

Comments (19)

hrfee avatar hrfee commented on August 20, 2024

Hi, when you downloaded jfa-go it should have came with a data folder. Can you check that data/web/js/setup.js exists? Also, could you post jfa-go's log output when you try to load the page?

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

Yeah, its existed i guess

[INFO] 18:34:01 Loading routes [INFO] 18:34:01 Loading setup @ 0.0.0.0:8056 [GIN] GET(/) => 200 [GIN] GET(/js/setup.js) => 200 [GIN] GET(/banner.svg) => 200 [GIN] GET(/favicon-32x32.png) => 200 [GIN] GET(/css/bundle.css) => 200 [GIN] GET(/js/setup.js) => 200 [GIN] GET(/favicon.ico) => 200 [GIN] GET(/) => 200 [GIN] GET(/css/bundle.css) => 200 [GIN] GET(/js/setup.js) => 200 [GIN] GET(/css/remixicon.css) => 200 [GIN] GET(/) => 200 [GIN] GET(/js/setup.js) => 200 [GIN] GET(/banner.svg) => 304 [GIN] GET(/favicon-32x32.png) => 304

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Are you using docker? I just realized the stable tag hasn't been updated in a while so it might be broken.

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Also, which version are you using? When you run jfa-go, it will print the version at the top like this:

jfa-go version: git (2c8be42)

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

no, i was using this build before :
https://github.com/hrfee/jfa-go/releases/download/v0.3.0/jfa-go_0.3.0_Windows_x86_64.tar.gz

and then i try with ur nightly build too:
jfa-go version: 0.0.0 (8eed4b0)
https://builds.hrfee.pw/repo/hrfee/jfa-go/build/8eed4b012783f4cf78fcba7635265fc0d95efd48/jfa-go_git-8eed4b0_Windows_x86_64.tar.gz

same issue

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

Chrome log :
setup.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.

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

This is weird, even when I run the same version on windows the MIME type is text/javascript. Could you go to the network tab in dev tools, select the setup.js request, and look at the response? It should start like this:
screenshot

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

There is no response, i think because it was blocked. all i can get is response header

HTTP/1.1 200 OK Accept-Ranges: bytes Content-Length: 12659 Content-Type: text/plain; charset=utf-8 Last-Modified: Fri, 05 Feb 2021 18:28:33 GMT Date: Mon, 08 Feb 2021 01:53:41 GMT

i was searching and stumbled upon this gin-gonic/gin#1584
could be something related to my error?

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

I doubt it, this is just loading a static file so BindJSON isn't called. Could you try this build? The internal files are embedded inside the executable, so there is no data directory.

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

2021/02/08 09:53:18 Using internal storage [INFO] 09:53:18 Failed to load language files: open lang/common\en-us.json: file does not exist

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Ah, the embed library used for the files uses /, but since you're on windows the filepath.Join function uses \. I'll fix that now.

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Ok, ive added a fix to this version.

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

still the same problem
Loading module from “http://localhost:8056/js/setup.js” was blocked because of a disallowed MIME type (“text/plain”).

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Could you open Powershell and run: Invoke-WebRequest http://localhost:8056/js/setup.js? It should look like this:

StatusCode        : 200                                                                                                                                                   StatusDescription : OK                                                                                                                                                    Content           : (()=>{const v=(e,t,i)=>{let n=new                                                                                                                     
                    XMLHttpRequest;window.URLBase&&(e=window.URLBase+e),n.open("GET",e,!0),n.responseType="json",n.setRequestHeader("Authorization","Bearer 
                    "+window.token),n.setRequestHe…
RawContent        : HTTP/1.1 200 OK
                    Accept-Ranges: bytes
                    Date: Mon, 08 Feb 2021 13:48:54 GMT
                    Content-Length: 12659
                    Content-Type: application/javascript
                    
                    (()=>{const v=(e,t,i)=>{let n=new XMLHttpRequest;window.URLBase&&(e…
Headers           : {[Accept-Ranges, System.String[]], [Date, System.String[]], [Content-Length, System.String[]], [Content-Type, System.String[]]}
Images            : {}
InputFields       : {}
Links             : {@{outerHTML=<a href="?lang=${o}" class="button input ~neutral field mb-half">${t.response[o]}</a>; tagName=A; href=?lang=${o}; class=button input 
                    ~neutral field mb-half}, @{outerHTML=<a href="https://weblate.hrfee.pw">Weblate</a>; tagName=A; href=https://weblate.hrfee.pw}, @{outerHTML=<a 
                    href="https://mailgun.com">Mailgun</a>; tagName=A; href=https://mailgun.com}, @{outerHTML=<a href="https://strftime.ninja/">strftime.ninja</a>; 
                    tagName=A; href=https://strftime.ninja/}}
RawContentLength  : 12659
RelationLink      : {}

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024
StatusCode        : 200
StatusDescription : OK
Content           : (()=>{const v=(e,t,i)=>{let n=new XMLHttpRequest;window.URLBase&&(e=window.URLBase+e),n.open("GET",
                    e,!0),n.responseType="json",n.setRequestHeader("Authorization","Bearer
                    "+window.token),n.setRequestHe...
RawContent        : HTTP/1.1 200 OK
                    Accept-Ranges: bytes
                    Content-Length: 12659
                    Content-Type: text/plain; charset=utf-8
                    Date: Mon, 08 Feb 2021 15:10:09 GMT

                    (()=>{const v=(e,t,i)=>{let n=new XMLHttpRequest;window.UR...
Forms             : {}
Headers           : {[Accept-Ranges, bytes], [Content-Length, 12659], [Content-Type, text/plain; charset=utf-8],
                    [Date, Mon, 08 Feb 2021 15:10:09 GMT]}
Images            : {}
InputFields       : {}
Links             : {@{innerHTML=${t.response[o]}; innerText=${t.response[o]}; outerHTML=<A class="button input
                    ~neutral field mb-half" href="?lang=${o}">${t.response[o]}</A>; outerText=${t.response[o]};
                    tagName=A; class=button input ~neutral field mb-half; href=?lang=${o}}, @{innerHTML=Weblate;
                    innerText=Weblate; outerHTML=<A href="https://weblate.hrfee.pw">Weblate</A>; outerText=Weblate;
                    tagName=A; href=https://weblate.hrfee.pw}, @{innerHTML=Mailgun; innerText=Mailgun; outerHTML=<A
                    href="https://mailgun.com">Mailgun</A>; outerText=Mailgun; tagName=A; href=https://mailgun.com},
                    @{innerHTML=strftime.ninja; innerText=strftime.ninja; outerHTML=<A
                    href="https://strftime.ninja/">strftime.ninja</A>; outerText=strftime.ninja; tagName=A;
                    href=https://strftime.ninja/}}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 12659

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Ok, so the content is right at least. I'll try to force set the content-type header maybe.

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

Ah, according to this stackoverflow post, Go assigns the content-type based on a mapping stored in the System Registry on Windows, so its a pretty common issue since installing/uninstalling software can change the mapping. I guess I'll try to add a built in one so the system doesn't affect this.

from jfa-go.

mezzovide avatar mezzovide commented on August 20, 2024

Changing .js from text/plain to application/javascript in the registry, and now it works! damn windows. Solved. Thanks.

from jfa-go.

hrfee avatar hrfee commented on August 20, 2024

I also added a manual override to the latest unstable, so hopefully this issue doesn't plague others.

from jfa-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.