seed-rs / seed-rs-realworld

Exemplary real world application built with Seed
https://seed-rs.org/
MIT License
123 stars 15 forks source link

localhost:8000 displays a blank page after running cargo make serve #1

Closed robwebbjr closed 5 years ago

robwebbjr commented 5 years ago

Hi. Thanks for helping Seed to get off the ground. Noob to webdev and Rust, but I followed instructions and got a blank page.

Page source shows: `<!DOCTYPE html>

Conduit

`

I am running: rustc 1.37.0 (eae3437df 2019-08-13) on Xubuntu 19.04 Disco Dingo in Firefox on a Dell G7.

I'd really like to use Seed with actors and WASM; is there anything I should know about using Seed with an actor model?

Thanks for your help

P.S. email is rob.webb.jr@gmail.com

MartinKavik commented 5 years ago

Hi, thanks for the first issue 🥇!

Some questions to investigate your blank page issue:

  1. What's your wasm-pack version? (just write wasm-pack --version to terminal)
  2. Does demo work for you?
  3. Have you tried other browsers? Which versions?
  4. Do you see errors in Firefox's and Chrome's web console? (js errors, warnings, etc or failed requests)
  5. Does cargo make test_h_firefox pass?
  6. Try to run cargo make build_release instead of build before cargo make serve. Does it help?

I'd really like to use Seed with actors and WASM; is there anything I should know about using Seed with an actor model?

There are only some examples with actor model in the server side, there is nothing like Yew's agents. Just create a new issue in the main Seed's repository and write about your use-case / gist example - we will continue discussion about actors there.

Good luck!

robwebbjr commented 5 years ago

Hi, Martin; thanks for your quick reply!

Thank you; that's my very first first-issue medal...

Anyway:

wasm-pack 0.8.1,

clicking on the demo link takes me to a site that seems functional; I can click on things to navigate, etc.,

I have not tried other browsers, except that I can say that Seed (and your example) does not compile correctly on a Chromebook running Linux beta (other Rust stuff does, though...),

I'm using Firefox Quantum 68.0.2,

Aha! There is this in the JavaScript errors: Loading module from “ http://localhost:8000/pkg/package.js” was blocked because of a disallowed MIME type (“text/html”).

And this from make test: Error: failed to download from https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz Caused by: [6] Couldn't resolve host name

Running cargo make build_release did not make a difference

So I'm gonna go google disallowed mime types; please let me know if you have a quick fix.

Thanks for you time!

Robert

On Mon, Aug 26, 2019 at 3:30 PM MartinKavik notifications@github.com wrote:

Hi, thanks for the first issue 🥇!

Some questions to investigate your blank page issue:

  1. What's your wasm-pack version? (just write wasm-pack --version to terminal)
  2. Does demo https://seed-rs-realworld.netlify.com/ work for you?
  3. Have you tried other browsers? Which versions?
  4. Do you see errors in Firefox's and Chrome's web console https://developer.mozilla.org/en-US/docs/Tools/Web_Console? (js errors, warnings, etc or failed requests)
  5. Does cargo make test_h_firefox pass?
  6. Try to run cargo make build_release instead of build before cargo make serve. Does it help?

I'd really like to use Seed with actors and WASM; is there anything I should know about using Seed with an actor model?

There are only some examples https://github.com/David-OConnor/seed/blob/master/examples/server_integration/server/src/count_actor.rs with actor model in the server side, there is nothing like Yew's agents https://github.com/yewstack/yew#agents---actors-model-inspired-by-erlang-and-actix . Just create a new issue in the main Seed's repository https://github.com/David-OConnor/seed and write about your use-case / gist example - we will continue discussion about actors there.

Good luck!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MartinKavik/seed-rs-realworld/issues/1?email_source=notifications&email_token=ALTKUB5CYGNB6ZAABRNYJL3QGRKPDA5CNFSM4IPTMUAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5F4BMY#issuecomment-525058227, or mute the thread https://github.com/notifications/unsubscribe-auth/ALTKUB657NRLC2ZRAEYIGM3QGRKPDANCNFSM4IPTMUAA .

-- The Great Secret? "It is, and It isn't."

MartinKavik commented 5 years ago

http://localhost:8000/pkg/package.js” was blocked because of a disallowed MIME type (“text/html”).

I think that browser modifies mime type or server sends incorrect.

Try:

  1. Run cargo make serve
  2. Open localhost:8000
  3. Look at the terminal where server is running, you should see something like:
    MicroServer running on port 8000!
    Serving .
    Spa support: true. Root: index.html
    A((File { resp: Response { status: 200, version: HTTP/1.1, headers: {"content-length": "1044", "c
    ontent-type": "text/html", "accept-ranges": "bytes", "last-modified": "Tue, 16 Jul 2019 19:01:54
    GMT"}, body: Body } },))
    ....

    Find all content-types - I see:

    • text/html
    • application/javascript -> same for you?
    • application/wasm
    • text/html
    • image/jpeg
    • image/svg+xml

Or you can try edit index.html: From:

<script type="module">

to:

<script type="module" crossorigin="anonymous">

(Source)

robwebbjr commented 5 years ago

OK, so I only see this in the terminal:

B((File { resp: Response { status: 200, version: HTTP/1.1, headers: {"content-length": "1023", "content-type": "text/html", "accept-ranges": "bytes", "last-modified": "Mon, 26 Aug 2019 18:21:52 GMT"}, body: Body(Streaming) } },))

And then, I change the Githubissues.

  • Githubissues is a development platform for aggregating issues.