### Bug description

Loading functions from either from local JS/WASM files or from observablehq notebooks has stopped working quarto-1.0.36 macos r4.2.0

Consider the following code, which loads the `rand` function from `@ljcolling/rand` and then makes runs it on a button press

```{ojs}
import {rand} from "@ljcolling/rand"
```

```{ojs}
mutable d = null
```

```{ojs}
{
  return d === null ? null : d["m"].map((v) => v.x);
}
```

```{ojs}
viewof clicked = Inputs.button("Click me")
```

```{ojs}
{
  if (clicked) {
    mutable d = rand(1, 1, 10, 10);
  }
}
```

Clicking the button results in the following error: 

```
OJS Error
TypeError: rand is not a function
```

However, this code works as expected with no errors when rendering with quarto-0.9.163 or on the observablehq website (https://observablehq.com/@ljcolling/ojs-bug)

### `quarto check` Output

```bash
[✓] Checking Quarto installation......OK
      Version: 1.0.36
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.12
      Path: /usr/local/opt/python@3.9/bin/python3.9
      Jupyter: 4.9.1
      Kernels: python3

(\) Checking Jupyter engine render....2022-07-24 15:48:15,105 - traitlets - WARNING - Kernelspec name python3 cannot be found!


No such kernel named python3
[✓] Checking Jupyter engine render....OK
```

### `quarto tools check` Output

```bash
[✓] Inspecting tools

Tool         Status                    Installed     Latest  
chromium     Not installed             ---           869685  
tinytex      External Installation     ---           v2022.07
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
cscheid
2022-07-24T14:53:42Z
ljcolling
bug ojs-engine
Future
closed
Externally loaded JS/WASM functions stopped working in ojs blocks
https://github.com/quarto-dev/quarto-cli/issues/1513