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

Error when compiling with Typescript #150

Closed
chrisbenincasa opened this issue May 13, 2024 · 3 comments
Closed

Error when compiling with Typescript #150

chrisbenincasa opened this issue May 13, 2024 · 3 comments

Comments

@chrisbenincasa
Copy link
Contributor

@tunarr/server:build: ../node_modules/.pnpm/thread-stream@3.0.0/node_modules/thread-stream/index.d.ts:79:61 - error TS1183: An implementation cannot be declared in ambient contexts.
@tunarr/server:build: 
@tunarr/server:build: 79   emit(eventName: string | symbol, ...args: any[]): boolean {
@tunarr/server:build:                                                                ~
@tunarr/server:build: 
@tunarr/server:build: 
@tunarr/server:build: Found 1 error in ../node_modules/.pnpm/thread-stream@3.0.0/node_modules/thread-stream/index.d.ts:79
@tunarr/server:build: 
@tunarr/server:build:  ELIFECYCLE  Command failed with exit code 2.

This stems from the fact that thread-stream provides implementation in a declaration file, which is not valid Typescript:

https://github.com/pinojs/thread-stream/blob/main/index.d.ts#L79-L82

As a workaround I used pnpm patch with these changes:

https://gist.github.com/chrisbenincasa/498e844fe7033c3230c8abe97c149602

@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@kylejeske
Copy link
Contributor

+1 - using this as a dep for any package consuming it will throw an error, unless you turn skipLibCheck to true.

@chrisbenincasa
Copy link
Contributor Author

I'd be happy to contribute the fix, but hooking up a test for this is a little more involved, since it would require adding a verification build step on the declaration file, which might be a little involved for somebody not familiar with the layout of this repo.

chrisbenincasa added a commit to chrisbenincasa/thread-stream that referenced this issue May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants