Code Monkey home page Code Monkey logo

Comments (8)

robwebbjr avatar robwebbjr commented on May 24, 2024 2

Thank you.
Seed rocks, and Martin makes it better.

from seed-rs-realworld.

MartinKavik avatar MartinKavik commented on May 24, 2024

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!

from seed-rs-realworld.

robwebbjr avatar robwebbjr commented on May 24, 2024

from seed-rs-realworld.

MartinKavik avatar MartinKavik commented on May 24, 2024

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)

from seed-rs-realworld.

robwebbjr avatar robwebbjr commented on May 24, 2024

from seed-rs-realworld.

MartinKavik avatar MartinKavik commented on May 24, 2024

It's weird. I need to do more experiments - I'll install probably virtualbox with your version of Xubuntu tomorrow (it's 2.00 AM now in CZ) and I'll try to find out something.

BTW, is this part correct?:

Yeah, it's almost copy-pasted from official docs and the same code is executed in the demo.

I think it's something OS specific (bug / feature).
In the meantime, try to find out why you can't download geckodriver (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
)

from seed-rs-realworld.

robwebbjr avatar robwebbjr commented on May 24, 2024

from seed-rs-realworld.

MartinKavik avatar MartinKavik commented on May 24, 2024

The hardest problems have the simplest solutions.. look at c231f8a.

Explanation

  • Command build only compiles Rust but doesn't create Wasm file and its init. JS script. So that the file /pkg/package.js hasn't been ever created and because local server redirects what is not file to index (because we want to handle all routes by our application) => server returns text/html.

Note

  • I've tested it on Xubuntu with Firefox in VMware Player and it works. I've tested it also in Chrome but the whole browser freezes after a moment (however I saw a loaded application for a few seconds before crash). Probably Chrome bug - if I remember correctly Chrome was unstable with Wasm code even on Windows.

Close the issue, pls, if you don't have other questions :)

from seed-rs-realworld.

Related Issues (8)

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.