Skip to content

[new feature] missing node.js support #3

@fuddl

Description

@fuddl

Describe the bug

This library can only be used in the browser because among other this it requires the window object.

To Reproduce

Steps to reproduce the behavior:

  1. mkdir test
  2. cd test
  3. npm i jsvotable
  4. echo 'const JsVotable = require("./node_modules/jsvotable/JsVotable.min.js")' > test.js
  5. node test.js

or alternatively:

  1. echo 'const JsVotable = require("./node_modules/jsvotable/src/JsVotable.js")' > test.js
  2. node test.js

Expected behavior

The script should be executed. (and nothing should happen)

Actual behavior

Error message appears:

ReferenceError: window is not defined
    at test/node_modules/jsvotable/JsVotable.min.js:1:31253

or alternativly

ReferenceError: define is not defined
    at Object.<anonymous> (test/node_modules/jsvotable/src/JsVotable.js:22:2)

Desktop

  • OS: macOS
  • Browser: no browser (node.js)
  • Version: all versions of node js

Additional context

It would be very nice

 🥺
👉👈

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions