# bundle.run errors breaking notebooks

**URL:** <https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050>\
**Category:** Uncategorized\
**Created:** [August 3, 2018, 4:10am UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050 "2018-08-03T04:10:01Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaunlebron](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/shaunlebron/32/81_2.png) [@shaunlebron](https://talk.observablehq.com/u/shaunlebron)\
**Post date:** [August 3, 2018, 4:10am UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/1 "2018-08-03T04:10:01Z")

</div>

My notebooks often need [bundle.run](https://bundle.run/) to load npm libs, as officially recommended for [stubborn modules](https://beta.observablehq.com/@tmcw/requiring-modules-troubleshooting). But lately, the service has been failing, causing my notebooks to break.

For example, all of these are down at the moment:

- ❌ [https://bundle.run/lru-cache@4.1.3](https://bundle.run/lru-cache@4.1.3)
- ❌ [https://bundle.run/bintrees@1.0.2](https://bundle.run/bintrees@1.0.2)
- ❌ [https://bundle.run/linear-solve@1.2.1](https://bundle.run/linear-solve@1.2.1)
- ❌ [https://bundle.run/lodash.debounce@4.0.8](https://bundle.run/lodash.debounce@4.0.8)

For the short term, I’ve reported a [packd issue](https://github.com/Rich-Harris/packd/issues/53#issuecomment-410103118).

For the longer term, I wonder if it makes sense for Observable to offer an endpoint to cache and serve modules loaded from bundle.run, since they seem pretty important to keeping our notebooks stable.

---

<div class="post-metadata">

**Author:** ![shaunlebron](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/shaunlebron/32/81_2.png) [@shaunlebron](https://talk.observablehq.com/u/shaunlebron)\
**Post date:** [August 6, 2018, 4:22pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/2 "2018-08-06T16:22:49Z")

</div>

The issue seems to be fixed now. I’m not sure what causes bundle.run to fail intermittently like this.

Let me know if Observable caching UMD-converted modules from bundle.run or others for notebook stability seems reasonable.

---

<div class="post-metadata">

**Author:** ![tom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tom/32/2262_2.png) [@tom](https://talk.observablehq.com/u/tom)\
**Post date:** [August 6, 2018, 8:17pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/3 "2018-08-06T20:17:57Z")

</div>

Yep, it’s been a bummer that bundle.run isn’t 100% stable. We’re weighing different options, including hosting an instance, re-caching, or just trying to contribute where we see bugfixes. As it stands, there unfortunately is only so much good that immutable caching can do, given that bundle.run often fails to build packages.

---

<div class="post-metadata">

**Author:** ![jaynox](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jaynox](https://talk.observablehq.com/u/jaynox)\
**Post date:** [August 8, 2018, 3:58pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/4 "2018-08-08T15:58:15Z")

</div>

Yesterday [https://wzrd.in](https://wzrd.in) was also down all day.

---

<div class="post-metadata">

**Author:** ![RandomFractals](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/randomfractals/32/759_2.png) [@RandomFractals](https://talk.observablehq.com/u/RandomFractals)\
**Post date:** [August 8, 2018, 4:22pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/5 "2018-08-08T16:22:00Z")

</div>

hah! it’s days like that I wish more folks moved to proper es6 modules and hosted them on [unpkg.com](http://unpkg.com) 😉

---

<div class="post-metadata">

**Author:** ![jaynox](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jaynox](https://talk.observablehq.com/u/jaynox)\
**Post date:** [August 9, 2018, 8:16pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/6 "2018-08-09T20:16:05Z")

</div>

It’s been down for 3 days now, probably was down prior to when I noticed, but I was relying on wzrd.in a couple weeks ago. There is some problem in that they are not serving https back properly. Any ideas on who to contact or how to nudge them to get back online properly?

---

<div class="post-metadata">

**Author:** ![shaunlebron](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/shaunlebron/32/81_2.png) [@shaunlebron](https://talk.observablehq.com/u/shaunlebron)\
**Post date:** [August 9, 2018, 8:51pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/7 "2018-08-09T20:51:52Z")

</div>

advice is to use [http://bundle.run](http://bundle.run) instead (which seems more reliable, albeit still has problems).

you can report wzrd.in issues here: [https://github.com/browserify/wzrd.in/issues](https://github.com/browserify/wzrd.in/issues)

---

<div class="post-metadata">

**Author:** ![jaynox](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jaynox](https://talk.observablehq.com/u/jaynox)\
**Post date:** [August 9, 2018, 10:50pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/8 "2018-08-09T22:50:46Z")

</div>

Hey thanks! bundle.run worked, will ping the wzrd folks as well.

---

<div class="post-metadata">

**Author:** ![shaunlebron](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/shaunlebron/32/81_2.png) [@shaunlebron](https://talk.observablehq.com/u/shaunlebron)\
**Post date:** [August 11, 2018, 3:52pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/9 "2018-08-11T15:52:45Z")

</div>

While we’re on the topic—I just now tried a few libraries related to unit conversion that I needed, and all of them required bundle.run to work.

Of course it’s not that simple to have `require` “just work” for everything, but I’m starting to wonder if `require("foo@1.2.3")` should or could be made to automatically fall back to something like bundle.run or a reliable cache thereof.

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [August 12, 2018, 10:32pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/10 "2018-08-12T22:32:01Z")

</div>

For the record, I ran into the same problem at the end of May: [https://github.com/Rich-Harris/packd/issues/49](https://github.com/Rich-Harris/packd/issues/49)

---

<div class="post-metadata">

**Author:** ![esperanc](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/esperanc/32/897_2.png) [@esperanc](https://talk.observablehq.com/u/esperanc)\
**Post date:** [September 9, 2019, 4:50pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/11 "2019-09-09T16:50:38Z")

</div>

I am having the same problem today (September 9th) - a module that worked yesterday (xml2js) does not work anymore…

---

<div class="post-metadata">

**Author:** ![andreasplesch](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/andreasplesch/32/676_2.png) [@andreasplesch](https://talk.observablehq.com/u/andreasplesch)\
**Post date:** [November 17, 2019, 11:44pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/12 "2019-11-17T23:44:27Z")

</div>

same problem today, but wzrd.in worked.

---

<div class="post-metadata">

**Author:** ![severo](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/severo/32/786_2.png) [@severo](https://talk.observablehq.com/u/severo)\
**Post date:** [April 1, 2020, 9:02am UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/13 "2020-04-01T09:02:00Z")

</div>

What is the current best practice?

I have been told the recommendation is to download the JS module, ie. [https://bundle.run/node-matrices@1.0.0](https://bundle.run/node-matrices@1.0.0), then attach the file to the notebook, and finally require the attached module, replacing

```auto
Matrix = require('https://bundle.run/node-matrices@1.0.0')

```

by

```auto
Matrix = require(await FileAttachment("node-matrices-1.0.0.js").url())

```

Is it correct? Is there a preferred alternative?

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [April 1, 2020, 12:42pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/14 "2020-04-01T12:42:34Z")

</div>

One workaround that helped me to circumvent cached broken builds was to attach a cachebreaking param to the URL, e.g. `https://bundle.run/node-matrices@1.0.0?cb123`. I imagine this could be automated to some degree and integrated into a `require` wrapper.

---

<div class="post-metadata">

**Author:** ![abitrolly](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/abitrolly/32/7214_2.png) [@abitrolly](https://talk.observablehq.com/u/abitrolly)\
**Post date:** [August 30, 2021, 7:14am UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/15 "2021-08-30T07:14:57Z")

</div>

Can the cachebreaking exhaust `bundle.run` storage space? Looks like it is unable to process new packages.

> <https://github.com/Rich-Harris/packd/issues/150>
>
> https://bundle.run/nearley@2.20.1/lib/compile.js
> \`\`\`
> ENOSPC: no space left on …device, mkdir '/tmp/2210d0e2b98537a4a2857bb8f534a1d96b1eea1d'
> \`\`\`

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [August 30, 2021, 3:13pm UTC](https://talk.observablehq.com/t/bundle-run-errors-breaking-notebooks/1050/16 "2021-08-30T15:13:24Z")

</div>

Yes, it would appear that each hash [considers the full query](https://github.com/Rich-Harris/packd/blob/291ab68fe921939554805450e1dbba82f9cf4299/server/serve-package.js#L116). A static cachebreaker should be fine, but with a dynamic one (like timestamps) you’d likely be spamming bundle.run.
