esm-dev/esm.sh

@observablehq/plot prototypes are missing a method due to skipped side effects

Closed this issue · 0 comments

Failing module

Error

Classes in the bundle served by esm.sh are missing a method because a module import side effect isn't applied.

Correct JSDelivr ESM import:

(await import("https://cdn.jsdelivr.net/npm/@observablehq/plot@0.6.13/+esm")).Mark.prototype.plot

esm.sh import with missing method:

(await import("https://esm.sh/@observablehq/plot@0.6.13")).Mark.prototype.plot

The library mutates the prototype as a side effect in one of its core modules:
https://github.com/observablehq/plot/blob/28c7ebc55a4fd78b4ef264f658ce9109c7c94eaa/src/plot.js#L375

Additional info

  • esm.sh version: v135
  • Browser version: n/a - tested with targets es2015, es2022, esnext