Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.21k stars 370 forks source link

[Bug] ESM doesn't work without "type": "module" in node #3080

Open JamesAPetts opened 3 months ago

JamesAPetts commented 3 months ago

Bug description

Running vtk.js on the backend doesn't work without modifying the package.json.

(Maybe this is a feature request?)

Steps to reproduce

Try installing @kitware/vtk.js on node when using ESM. The package is incorrectly loaded, and it will run properly when "type": "module" is added.

Detailed Behavior

No response

Expected Behavior

It works OOTB in node. Is there any other issue that would be caused by adding "type": "module" to the package.json?

Environment

daker commented 3 months ago

What's the purpose of running it on the backend?