plotly / plotly/plotly.js

Node.js returns self is not defined

Open
#7,276 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

When initializing the library in Node.js (v. 19)
var p = require("plotly.js-dist")
I get an error with the message: "self is not defined"

.. /node_modules/plotly.js-dist/plotly.js:16
})(self, function() {

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with require("plotly.js-dist") in Node.js v19 and inspect node_modules/plotly.js-dist/plotly.js, especially the self reference shown at line 16. Determine why the distributed package cannot initialize in Node.js; done means the same require call no longer fails with "self is not defined".

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.