Problem viewing Notebook 2.0 docs in Observable 1

I am having problems moving between observablehq.com and new.observablehq.com for Notebook 2.0 docs.

If I create a document in new.observablehq.com with the Notebook 2.0 library, I can, as expected view the document in new.observablehq.com. If I try to view it in observablehq.com I sometimes get the (expected) view of the page with the warning at the top 'This notebook uses features only available in the new Observable.’ But for some documents, I get the following more severe errors:

Application error: a client-side exception has occurred (see the browser console for more information). With the console reporting:

[Error] Error: duplicate resolution — 3999-eb7c9b525e00cb6c.js:1:1180
(anonymous function) (_app-82353a9688257f5f.js:23:6287)
a5 (framework-6761de23ac53dea2.js:1:70194)
(anonymous function) (framework-6761de23ac53dea2.js:1:70706)
lX (framework-6761de23ac53dea2.js:1:57379)
uY (framework-6761de23ac53dea2.js:1:91155)
e (framework-6761de23ac53dea2.js:1:111472)
(anonymous function) (framework-6761de23ac53dea2.js:1:111481)
oI (framework-6761de23ac53dea2.js:1:111993)
oS (framework-6761de23ac53dea2.js:1:95365)
E (framework-6761de23ac53dea2.js:1:137872)
T (framework-6761de23ac53dea2.js:1:138402)
[Error] Error: duplicate resolution — 3999-eb7c9b525e00cb6c.js:1:1180
(anonymous function) (_app-82353a9688257f5f.js:23:6287)
a5 (framework-6761de23ac53dea2.js:1:70194)
(anonymous function) (framework-6761de23ac53dea2.js:1:70706)
lX (framework-6761de23ac53dea2.js:1:57379)
uY (framework-6761de23ac53dea2.js:1:91155)
e (framework-6761de23ac53dea2.js:1:111472)
(anonymous function) (framework-6761de23ac53dea2.js:1:111481)
oI (framework-6761de23ac53dea2.js:1:111993)
oS (framework-6761de23ac53dea2.js:1:95365)
E (framework-6761de23ac53dea2.js:1:137872)
T (framework-6761de23ac53dea2.js:1:138402)
[Error] Error: duplicate resolution — 3999-eb7c9b525e00cb6c.js:1:1180
(anonymous function) (_app-82353a9688257f5f.js:23:6287)
Z (main-c58989c3021235ab.js:1:11440)
fn (main-c58989c3021235ab.js:1:10486)
componentDidCatch (main-c58989c3021235ab.js:1:8951)
(anonymous function) (framework-6761de23ac53dea2.js:1:70814)
lX (framework-6761de23ac53dea2.js:1:57379)
uY (framework-6761de23ac53dea2.js:1:91155)
e (framework-6761de23ac53dea2.js:1:111472)
(anonymous function) (framework-6761de23ac53dea2.js:1:111481)
oI (framework-6761de23ac53dea2.js:1:111993)
oS (framework-6761de23ac53dea2.js:1:95365)
E (framework-6761de23ac53dea2.js:1:137872)
T (framework-6761de23ac53dea2.js:1:138402)
[Error] A client-side exception has occurred, see here for more info: Client-side Exception Occurred | Next.js
(anonymous function) (_app-82353a9688257f5f.js:23:6287)
Z (main-c58989c3021235ab.js:1:11457)
fn (main-c58989c3021235ab.js:1:10486)
componentDidCatch (main-c58989c3021235ab.js:1:8951)
(anonymous function) (framework-6761de23ac53dea2.js:1:70814)
lX (framework-6761de23ac53dea2.js:1:57379)
uY (framework-6761de23ac53dea2.js:1:91155)
e (framework-6761de23ac53dea2.js:1:111472)
(anonymous function) (framework-6761de23ac53dea2.js:1:111481)
oI (framework-6761de23ac53dea2.js:1:111993)
oS (framework-6761de23ac53dea2.js:1:95365)
E (framework-6761de23ac53dea2.js:1:137872)
T (framework-6761de23ac53dea2.js:1:138402)
[Debug] Flutter Web Bootstrap: Auto. (main.dart.js, line 7380)

This is a problem because I currently require the older observable interface to add thumbnails or add to collections.

For some pages created in this way, I sometimes simply see the ‘Oops, unexpected error’ page. For example this one:

https://observablehq.com/d/697a9585c7704ddb

(And this does display correctly as Test: Does not display in Observable 1.0 | Jo Wood | Observable)

Is this a known problem?

Yeah I’m looking at this! Thanks for that reproduction notebook, that helps. I think you already understand our intentions, but I’ll restate:

  • It is not our goal to make the content of 2.0 notebooks work in the 1.0 interface. As you say, it should show that banner: “This notebook uses features only available in the new Observable.”
  • It is our goal that the 1.0 interface must not crash when looking at a 2.0 notebook. As you say, lots of metadata can still only be configured in the 1.0 interface: collections, authors, thumbnails, history, etc.

(Separately, we are actively working on getting imports working in 2.0, which should let you import a 2.0 notebook into a 1.0 notebook, which should make it easier to live in this transitional state where some content is old and some is new.)

Thanks. Look forward to the V1/V2 import matching which would help considerably in transferring documents to V2.

If it helps, as far as I can determine I can avoid the error problem above if I always create the document first in Observable 1, then in Observable 2 move to the new runtime lib and add content there. Obviously not a permanent fix, but may help in diagnosing the cause of the problem.

@tophtucker Following this and I’m curious about “V1/V2 import matching” since I am experiencing trouble with using the import { namedFunction } from "@<myid>/<notebookThatWasV1AndIsNowV2" I get error “namedFunction is not defined” if the import statement is in an .ojs cell and “TypeError: Failed to resolve module specifier ‘@<myid>/<notebookThatWasV1AndIsNowV2’” if the import statement is in a .js cell.

I am experiencing trouble with using the import { namedFunction } from "@<myid>/<notebookThatWasV1AndIsNowV2" I get error “namedFunction is not defined” if the import statement is in an .ojs cell and “TypeError: Failed to resolve module specifier ‘@<myid>/<notebookThatWasV1AndIsNowV2’” if the import statement is in a .js cell.

The new import format from other observable pages is

import { namedFunction } from "observable:<myid>/<notebookThatWasV1AndIsNowV2"

That should work for all V2 notebooks, and quite possibly V1 notebooks if the imported functions use standard JS.

Thanks very much! Just figured this out while you were replying. It seems that there are some odd new artifacts, however, as one shifts from .ojs to .js. The notebook you are importing from must be explicitly ‘Republished’ (button at top) and the notebook doing the importing has to be refreshed for new or changed imports to be recognized (imported with new coding).

Crashes should be fixed, e.g. here: Test: Does not display in Observable 1.0 / Jo Wood | Observable

(Note that, for people who aren’t an editor of that notebook, it’ll redirect you to 2.0. If you’re an editor, it lets you stay on 1.0 with a banner so you can configure whatever metadata.)

Thanks. That removes some anxiety about converting my notebooks to 2.0.

As we’ve noted in other threads, imports aren’t fully working yet in Notebooks 2.0. Notebooks 2.0 currently uses the 1.0 backend for imports, which means you can only import 1.0-compatible notebooks public (or unlisted) notebooks. I’m working on this as we speak — it should be fixed soon!