TypeStrong / ts-node

TypeScript execution and REPL for node.js
https://typestrong.org/ts-node
MIT License
12.75k stars 529 forks source link

Dynamic require of xxx is not supported #2061

Closed moonthug closed 10 months ago

moonthug commented 10 months ago

Search Terms

throw Error('Dynamic require of "' + x + '" is not supported'); Dynamic require of xxx is not supported Dynamic require of "events" is not supported

Expected Behavior

It doesnt through an error?

Actual Behavior

Error thrown: Dynamic require of "events" is not supported

Steps to reproduce the problem

It comes from the ws package

Minimal reproduction

var require_websocket = __commonJS({
  "../../node_modules/roslib/node_modules/ws/lib/websocket.js"(exports, module) {
    "use strict";
    var EventEmitter = __require("events");
    ...

Specifications