Skip to content

[email protected] sideEffects breaks Delaunay class #99

@jloveless63

Description

@jloveless63

I performed an investigation on our code base where I replaced our usage of d3-voronoi with the usage of d3-delaunay. When doing so, with versions 5.1.6 and 5.2.0, I found an issue when running End-to-End tests against our code:

ERROR in ./node_modules/d3-delaunay/src/delaunay.js 26:15
Module parse failed: Unexpected token (26:15)
You may need an appropriate loader to handle this file type.
| return [x + Math.sin(x + y) * r, y + Math.cos(x - y) * r];
| }
> export default const Delaunay = /*@__PURE__*/ function () {
| class Delaunay {
| constructor(points) {

I found that back-stepping to version 5.1.5 alleviates the error, which is before d3-delaunay was marked as having no side effects. I have also found that, in version 5.2.0, changing the setting of sideEffects to:

 "sideEffects": [
   "./src/delaunay.js"
 ],

also alleviates the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions