seed-rs / seed-quickstart

Bare essentials to start a Seed app.
https://seed-rs.org/
101 stars 28 forks source link

Strict MIME type checking is enforced for module scripts per HTML spec. #28

Open gilescope opened 4 years ago

gilescope commented 4 years ago

On mac when cloning and then cargo make serve I get the following error on Chrome and Firefox:

The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

gilescope commented 4 years ago

Maybe cargo make serve isn't enough and I am missing a step?

gilescope commented 4 years ago

You get this error if 'cargo make watch' hasn't been successful or hasn't been run.

MartinKavik commented 4 years ago

You get this error if 'cargo make watch' hasn't been successful or hasn't been run.

I'll reopen this issue so I don't forget to add it into documentation, thanks for the issue!

najamelan commented 4 years ago

This is confusing for people that have never used seed and microserver before.

I think ideally cargo make serve should trigger a build on its own (cargo make should make this easy). Watching is something different all together, and when you are just wanting to check out seed, you don't necessarily count on changing files, so it's confusing that watch is required, as serve does generate some output making it look like it's building the project (actually it's just building microserver).

Another option is to use the --no-spa flag on microserver, since you are not counting on redirecting pkg/package.js to index.html, which would at least give a better error message.

MartinKavik commented 4 years ago

@najamelan

I think ideally cargo make serve should trigger a build on its own

It's a little bit more complicated - what build? Debug or Release? Should we add serve_release and watch_release? Then you can be confused when you run serve_release and then accidentally watch_debug - you would be serving the debug build although you've run serve_release. So we've decided to make it as simple as possible, especially for developers who already write their Seed app.

Another option is to use the --no-spa flag on microserver

It would break routing/redirecting from non-root paths, I don't think we can do that.


So.. I don't plan to update this quickstart by myself in the near future because I'll focus on Seeder, however I'm open to discussing better DX / API / tasks and then merge PRs. Thanks for the comment!

najamelan commented 4 years ago

Debug or Release?

I would think the same one you run on cargo make watch.