keplergl / keplergl/kepler.gl

[Bug][Jupyter Widget] When rendering in Databricks: Class constructor o cannot be invoked without 'new'

Open
#2,045 3 comments 1 reaction 1 assignee Claimed by @heshan0131 View on GitHub
jupyter
Dominant language
TypeScript
Stars
12k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
66

Description

**Describe the bug**
When trying to run the following code in a Databricks notebook

```
from keplergl import KeplerGl

import pandas as pd
df = pd.DataFrame({
"hex_id": ["8c2a100d26655ff"]
})

mp = KeplerGl()
mp.add_data(data=df, name="render_ipywidget")
mp
```

There is the following error:

```
deck: error during initialization of EnhancedColumnLayer({id: 'rokkbq1-hexagon-cell'}) TypeError: Class constructor o cannot be invoked without 'new'
TypeError: Class constructor o cannot be invoked without 'new'
at new t (cdn.jsdelivr.net/npm/keplergl-jupyter@%5E0.3.2/dist/index.js:42:346465)
```

**Expected behavior**
There should be no error and the widget should work like in plain Jupyter.

**Screenshots**
Screenshot 2022-11-29 at 07 59 00

**Environment (please complete the following information):**
- Python version: Python3
- keplergl Widget version 0.3.2

**Additional context**
To me this seems to be an issue with ES6. When I looked at the pretty printed JS, the error was close to a ´column-geometry´ object.
When I looked at the [deck.gl](http://deck.gl/) code (which is a dependency of [kepler.gl](http://kepler.gl/)) it seems that they call luma.gl/core to create a uid and I am wondering if [here](https://github1s.com/visgl/deck.gl/blob/HEAD/modules/layers/src/column-layer/column-geometry.ts#L15-L16) the “new” word has to be used?

**Summing up, I think this issue can be solved if the JS bundle target is explicitly set to ES6 in the [babel config](https://github.com/keplergl/kepler.gl/blob/master/bindings/kepler.gl-jupyter/js/babel.config.js#L26) for the kepler.gl jupyter widget.**

What do you think?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.