scittle 2023-07-24

For some reason when I try to load from a source file it doesn't work. It seems my browser doesn't load it

<script src="cljs/script.cljs"
                type="application/x-scittle">
        </script>
In the browser dev tools, it doesn't show up. I'm wondering if there is some kind of security for script tags of custom type?

No errors in the console?

How are you hosting the HTML file, in a server?

Babashka http-server, just serving the public directory from my local

if you can make a repro project I can run locally, I could try

I'll try too sometime this week. Thanks! I was wondering if mime type mattered. Babashka http-server doesn't have .cljs file extension going to application/x-scittle for example.

And I was using Microsoft Edge, didn't try in other browsers.

I tried a plain js script and that worked.

not sure, but I don't think scittle cares

The weird thing is, in the dev tools for Edge, you can see the loaded resources, the JS script appears, but not the cljs one. So it's like the browser refuses to load it.

Anyways, I'll try to create a repro

perhaps the issue is that your script tag has text content?

try it like this:

<script src="cljs/script.cljs" type="application/x-scittle"></script>

I think the code could be made more robust, prioritizing the src thing and then the code if there is no src thing

no, your example above contains more whitespace

I'm almost positive that this is the issue

try:

<script src="cljs/script.cljs" type="application/x-scittle"></script>
exactly like this not over multiple lines

Oh, really? Okay will try.

So me formatting the script tag on multiple line is what was breaking it.

feel free to file an issue, I'll fix it right away

Lol, I just created 68 but I'll close that one, thanks :)

no, it was just funny, no need to be sorry, it was literally almost at the same time :)

I think this fixes it but I have to test it tomorrow before I merge: https://github.com/babashka/scittle/pull/70

🤘 1