# How does dynamic import() work?

**URL:** https://clojureverse.org/t/how-does-dynamic-import-work/10701
**Category:** Beginners
**Tags:** clojurescript
**Created:** [April 23, 2024, 3:55am UTC](https://clojureverse.org/t/how-does-dynamic-import-work/10701 "2024-04-23T03:55:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zweifisch](https://clojureverse.org/user_avatar/clojureverse.org/zweifisch/32/5401_2.png) [@zweifisch](https://clojureverse.org/u/zweifisch)
#### Post date: [April 23, 2024, 3:55am UTC](https://clojureverse.org/t/how-does-dynamic-import-work/10701/1 "2024-04-23T03:55:23Z")

</div>

Like `(.then (js/import "https://esm.sh/quickjs-emscripten@0.25.0") js/console.log)`, but js/import isn’t there.

---

<div class="post-metadata">

### Author: ![thheller](https://clojureverse.org/user_avatar/clojureverse.org/thheller/32/534_2.png) [@thheller](https://clojureverse.org/u/thheller)
#### Post date: [April 23, 2024, 6:15am UTC](https://clojureverse.org/t/how-does-dynamic-import-work/10701/2 "2024-04-23T06:15:11Z")

</div>

`import` is currently a bit tricky to use since the closure compiler does not support it, or rather wants to compile it away and fails.

There is a helper in `shadow-cljs` when using [target :esm](https://v2.clojureverse.org/t/generating-es-modules-browser-deno/6116). There is also [js-await](https://v2.clojureverse.org/t/promise-handling-in-cljs-using-js-await/8998) to make that promise handling a bit nicer.

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [October 22, 2024, 6:15pm UTC](https://clojureverse.org/t/how-does-dynamic-import-work/10701/3 "2024-10-22T18:15:31Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
