Bug: Notebook title causes "multiple VERSIONs detected" error

Summary
If a notebook have the same name as imported package, it causes “multiple VERSIONs detected” error when importing.

Problem

I wanted to use Deck.gl in my notebook. My notebook title was deck, and I named imported package deck, which caused error like “multiple versions detected: undefined vs …” as shown in the screenshot below. Changing the notebook title and refreshing solved the problem.

Additional Information

Since import of deck.gl creates a variable “luma” in the global scope (deck.gl depends on luma.gl), notebook title luma also caused the same problem.

This is a bug with Deck.gl.

When you create Markdown like this:

md`# deck`

It is equivalent to HTML like this:

html`<h1 id="deck">deck</h1>`

When you have an element with an id attribute, it becomes a global variable. Hence, you can refer to the H1 element generated above like so:

deck

This will give you an HTMLHeadingElement.

Deck.gl checks the existence of the deck global to determine if you’ve already loaded the Deck.gl library. This means that any page with an element with the id “deck” will (erroneously) trigger this “multiple versions detected” error.

You can workaround this issue by using HTML instead of Markdown to generate your heading:

html`<h1>deck</h1>`

Deck.gl could also fix their library to have a more precise test for already being loaded, rather than checking the existence of a deck global.

3 Likes

Understood. I will report in uber/deck.gl issue.
Thank you for your investigation and explanation!