scittle 2024-12-19

I'm trying the new js/import and I get undefined if I log js/import to the console. I'm using the latest build - https://github.com/babashka/scittle/commit/6c3b5f56880142b6cf6f45e81ccd6da7749b71f6.

✅ 1

I figured it out - it's when I use 'latest' as the version: https://cdn.jsdelivr.net/npm/scittle@latest/dist/scittle.min.js

Lol infuriatingly it now works. I must have had a cached version or something. Sorry for the noise.

I guess this is a disadvantage of using @latest. 🤔

👍 1

Set up a test importing virtual-audio-graph from CDN from inside CLJS and it works great! Thanks for adding this. 🙏

🎉 1

I can't repro. This works for me:

<html>
  <head>
    <script src="" type="application/javascript"></script>
    <script type="application/x-scittle">
      (let [blob (js/Blob. #js ["export default function setup(sr) {console.log(1);}"] #js {:type "text/javascript"})
      ;; Create a URL object from the Blob
      url (js/URL.createObjectURL blob)]
  (.then (js/import url)
      (fn [module] (println "work"))
      (fn [error] (println "error"))
  )
)
    </script>
  </head>
  <body>
    <button onclick="my_alert()">
      Click me!
    </button>
  </body>
</html>

This also works for me:

(js/console.log js/import)
in the above HTML

@chris358 did you manage to find out why it didn't work for you?