Closed PGilbertSchmitt closed 1 year ago
This might be a case of an unsupported version of Node. Cirql was developed against the current LTS 18.13.0. Would you be able to attempt running this on a more up-to-date Nodejs installation?
That's exactly it. Literally one more minute of searching showed me that while EventTarget
exists in NodeJS since version 14.5.0
, the EventTarget()
constructor wasn't introduced until 15.0.0
. This is solved.
Describe the bug Receiving error
Uncaught ReferenceError: EventTarget is not defined
when importing or requiringcirql
.Example In my TypeScript project, I've installed
cirql
,zod
, andws
. However, when I attempt to import or requirecirql
, I get this failure:The above was run in the
node
repl. I receive the same error when I runimport cirql from 'cirql'
in my TypeScript file and execute it usingnpx ts-node FILE
. This also happens when I runimport cirql from 'cirql'
in the TS repl (viapnpm exec ts-node
) after I attempt introspection on thecirql
object. I do not have atsconfig.json
file, so this is the default configuration.Expected behavior I expect to be able to import the module.
Environment: