# import & concatenate

**URL:** <https://talk.observablehq.com/t/import-concatenate/10800>\
**Category:** Feedback\
**Created:** [September 4, 2026, 8:02am UTC](https://talk.observablehq.com/t/import-concatenate/10800 "2026-09-04T08:02:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neocarto](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/neocarto/32/6554_2.png) [@neocarto](https://talk.observablehq.com/u/neocarto)\
**Post date:** [September 4, 2026, 8:02am UTC](https://talk.observablehq.com/t/import-concatenate/10800/1 "2026-09-04T08:02:54Z")

</div>

```js
let viz = import("npm:geoviz@1.0.7")

```

works

```js
let version ="1.0.7"
let viz = import(`npm:geoviz@${version}`)

```

doesn’t work !  
RuntimeError: Failed to fetch dynamically imported module: npm:geoviz@1.0.7

---

<div class="post-metadata">

**Author:** ![tophtucker](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tophtucker/32/4781_2.png) [@tophtucker](https://talk.observablehq.com/u/tophtucker)\
**Post date:** [September 8, 2026, 8:22pm UTC](https://talk.observablehq.com/t/import-concatenate/10800/2 "2026-09-08T20:22:31Z")

</div>

Hm yeah it looks like dynamic imports allow interpolation only for a full URL. Not sure why that is. Either we’re doing some static analysis or it’s a bug.

Reproduction: [https://observablehq.com/@tophtucker/re-neocarto-on-import-interpolation](https://observablehq.com/@tophtucker/re-neocarto-on-import-interpolation)

✅ Full URL with interpolation

```js
import(`https://cdn.jsdelivr.net/npm/geoviz@${version}/+esm`)

```

✅ npm specifier

```js
import("npm:geoviz@1.0.7")

```

❌ npm specifier with interpolation

```js
import(`npm:geoviz@${version}`)

```

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [September 8, 2026, 9:59pm UTC](https://talk.observablehq.com/t/import-concatenate/10800/3 "2026-09-08T21:59:38Z")

</div>

Not a bug — import resolution requires static analysis. If you want to do a dynamic import you need to specify a full URL, as @tophtucker shows.
