Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '@d-fischer/typed-event-emitter/lib' or its corresponding type declarations. #554

Closed
mcumbers opened this issue Feb 23, 2024 · 2 comments
Labels

Comments

@mcumbers
Copy link

Bug Report

Code

import { EventSubWsListener } from '@twurple/eventsub-ws';

Expected behavior

The package imports correctly, and TypeScript is able to build.
Very similar issue to #334

Actual Behavior

Inline type imports aren't evaluated properly by npm, and TypeScript fails to build.

../node_modules/@twurple/eventsub-ws/lib/EventSubWsListener.d.ts:35:42 - error TS2307: Cannot find module '@d-fischer/typed-event-emitter/lib' or its corresponding type declarations.

35     readonly onUserSocketConnect: import("@d-fischer/typed-event-emitter/lib").EventBinder<[userId: string]>;

../node_modules/@twurple/eventsub-ws/lib/EventSubWsListener.d.ts:42:45 - error TS2307: Cannot find module '@d-fischer/typed-event-emitter/lib' or its corresponding type declarations.

42     readonly onUserSocketDisconnect: import("@d-fischer/typed-event-emitter/lib").EventBinder<[userId: string, error?: Error | undefined]>;

packages/eventsub-ws/src/EventSubWsListener.ts:51

	readonly onUserSocketConnect = this.registerEvent<[userId: string]>();

packages/eventsub-ws/src/EventSubWsListener.ts:59

	readonly onUserSocketDisconnect = this.registerEvent<[userId: string, error?: Error]>();

Environment

  • Version: 7.0.10
  • Node version: 18.18.0
  • Operating system: macOS 14.3.1
  • Package Manager: npm
  • Package Manager Version: 10.3.0
@d-fischer
Copy link
Member

This is apparently caused by the class not directly inheriting from EventEmitter - but I'd like to try finding a different solution than basically going through any, which is what the current PR does.

@d-fischer
Copy link
Member

I just discovered that an upgrade to TypeScript 5.3 fixes this issue. I'm gonna have to make some more infrastructural tests and adjustments though, to make sure that everything still builds smoothly. Either way, this fix will not be on the 7.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants