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

fileTypeFromStream throws an error in combination with strtok3@9.0.1 #681

Closed
3 tasks done
Borewit opened this issue Oct 13, 2024 · 0 comments · Fixed by #680
Closed
3 tasks done

fileTypeFromStream throws an error in combination with strtok3@9.0.1 #681

Borewit opened this issue Oct 13, 2024 · 0 comments · Fixed by #680
Labels

Comments

@Borewit
Copy link
Collaborator

Borewit commented Oct 13, 2024

Description

Release of strtok3 v9.0.1, will cause problems with file-type v19.5.0 (reason CI was failing). It exposes a the following issue:

file-type/index.js

Lines 13 to 17 in 0e91f7b

try {
return super.fromTokenizer(tokenizer);
} finally {
await tokenizer.close();
}

where the tokenizer is closed after return the promise, and not after resolving the promise.

Since strtok3 v9.0.1 to tokenizer is actually destroying the stream, which caused file-type to fail to read from the tokenizer.

Existing Issue Check

  • I have searched the existing issues and could not find any related to my problem.

ESM (ECMAScript Module) Requirement Acknowledgment

  • My project is an ESM project and my package.json contains the following entry: "type": "module".

File-Type Scope Acknowledgment

  • I understand that file-type detects binary file types and not text or other formats.
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.

1 participant