Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mootari opened this issue Mar 7, 2024 · 0 comments
Labels
browser Not working in Browser

Comments

@mootari
Copy link

mootari commented Mar 7, 2024

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
@mootari mootari added the browser Not working in Browser label Mar 7, 2024
@ije ije closed this as completed in 9ec4914 Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser Not working in Browser
Projects
None yet
Development

No branches or pull requests

1 participant