TypeError when embedding notebook

I am following the directions here under the section “Rendering cells” using this published notebook. My html file looks like this:

<!DOCTYPE html>                                                                                                         
<body>
  <script type="module">

    import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
    import  notebook  from "https://api.observablehq.com/@jeremy9959/covid-19-report-for-ct-counties.js";
    console.log(notebook) ;
    new Runtime().module(notebook, Inspector.into(document.body)) ;
  </script>
</body>

and I can verify in the console that the notebook object is obtained. However, nothing is rendered and the console reports:

TypeError: e is not a function.

I’m on ubuntu 18.04LTS using the python -m http.server to look at this file (python version 3.7+).

What am I missing?

I think you’re missing the API version parameter ?v=3 on the notebook URL

    import  notebook  from "https://api.observablehq.com/@jeremy9959/covid-19-report-for-ct-counties.js";

The embed below works fine

<!DOCTYPE html>                                                                                                         
<body>
  <script type="module">

    import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@4/dist/runtime.js";
    import  notebook  from "https://api.observablehq.com/@jeremy9959/covid-19-report-for-ct-counties.js?v=3";
    console.log(notebook) ;
    new Runtime().module(notebook, Inspector.into(document.body)) ;
  </script>
</body>
1 Like

Thanks, I didn’t realize that the ?v=3 was an API parameter, I thought it referred to a version of the notebook itself.