From e6aa1a331c37697b9de7e91b7db286eac245c8d7 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 26 Apr 2024 07:26:11 +0200 Subject: [PATCH] fix: point towards the CommonJS types In order to fix the following issue: > error TS1479: 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'. Consider writing a dynamic 'import("@socket.io/component-emitter")' call instead. > > 1 import { Emitter } from "@socket.io/component-emitter"; This problem was introduced in [1], when reworking the dual packaging. Related: https://github.com/socketio/socket.io-parser/issues/132 [1]: https://github.com/socketio/emitter/commit/ba6b56de2cd8d3cf705ab35fd8c501b68a7268bd --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 737000f..940848a 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "main": "./lib/cjs/index.js", "module": "./lib/esm/index.js", - "types": "./lib/esm/index.d.ts", + "types": "./lib/cjs/index.d.ts", "repository": { "type": "git", "url": "https://github.com/socketio/emitter.git"