You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any import will get the following TypeScript error: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'.
If I don't specify any export (just import OBSWebSocket from "obs-websocket-js";), an additional TypeError is thrown at runtime: OBSWebSocket is not a constructor. Manually specifying /json or /msgpack gets rid of this. The other error remains.
Versions Used (if applicable):
obs-websocket-js version: 5.0.5
obs-websocket plugin version:
obs-studio version:
node version:
The text was updated successfully, but these errors were encountered:
Description:
Package resolution is broken in a TypeScript project using CommonJS with Module and ModuleResolution set to
Node16
.Also see: https://arethetypeswrong.github.io/?p=obs-websocket-js%405.0.5 => node16 (from CJS).
This breaks importing completely.
Any import will get the following TypeScript error:
The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'.
If I don't specify any export (just
import OBSWebSocket from "obs-websocket-js";
), an additional TypeError is thrown at runtime:OBSWebSocket is not a constructor
. Manually specifying/json
or/msgpack
gets rid of this. The other error remains.Versions Used (if applicable):
The text was updated successfully, but these errors were encountered: