riatelab/bertin

Import error

mthh opened this issue · 2 comments

mthh commented

Just to clarify (I guess !) the issue reported by @lessthanweb in #83, when importing bertin.js (outside Observable), starting from 1.3.4 you get the following error:

bertin@1.3.4:23 Uncaught TypeError: Cannot read properties of undefined (reading 'contourDensity')
    at bertin@1.3.4:23:32172
    at bertin@1.3.4:1:175
    at bertin@1.3.4:1:254

Import is done as in the README / the examples:

<script src="https://cdn.jsdelivr.net/npm/bertin@1.5.4"></script>

Due to this error the bertin object is empty and it is not possible to call bertin.draw for example.

I think you are missing to include d3-contour in the dependencies of package.json so it fails when importing contourDensity here https://github.com/neocarto/bertin/blob/e44b71355ad0d0a4d79bee00f659e3d3e31ae2c5/src/layers/smooth.js#L5

Oops. Thanks Matthieu. I add this

Solved in bertin@1.5.5