Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(common): improve error handling in FileTypeValidator#16090

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
malkovitc wants to merge1 commit intonestjs:master
base:master
Choose a base branch
Loading
frommalkovitc:fix/optional-metadata-inheritance

Conversation

@malkovitc
Copy link

@malkovitcmalkovitc commentedDec 17, 2025
edited
Loading

PR Checklist

PR Type

  • Bugfix

What is the current behavior?

Issue Number:#15055

FileTypeValidator silently returnsfalse when ESM loading fails (e.g., in Jest without--experimental-vm-modules), making it difficult to diagnose why file validation is failing.

What is the new behavior?

  • Added warning log whenfile-type package fails to load due to ESM issues
  • Log message includes helpful hint about Jest configuration
  • Added fallback to mimetype check whenfallbackToMimetype option is enabled and loading fails

Does this PR introduce a breaking change?

  • Yes
  • No

@coveralls
Copy link

coveralls commentedDec 17, 2025
edited
Loading

Pull Request Test Coverage Report forBuild a9b78dd4-a143-4cb2-b05e-794efbbaf1be

Details

  • 5 of7(71.43%) changed or added relevant lines in1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to89.669%

Changes Missing CoverageCovered LinesChanged/Added Lines%
packages/common/pipes/file/file-type.validator.ts5771.43%
TotalsCoverage Status
Change from baseBuild afbac173-069d-498a-91a4-8be82fe7ca5c:-0.02%
Covered Lines:7421
Relevant Lines:8276

💛 -Coveralls

@kamilmysliwiec
Copy link
Member

Partial duplicate#15137

@malkovitc
Copy link
Author

Thanks for pointing that out! You're right, the#2581 fix overlaps with#15137.

I'll split this PR to keep only the FileTypeValidator changes (#15055 - ESM error logging and fallback). Will push an update shortly.

Add warning logs when file-type package fails to load due to ESMimport issues. This helps users debug issues when running testswith Jest without --experimental-vm-modules flag.When loading fails and fallbackToMimetype is enabled, the validatornow correctly falls back to mimetype comparison instead of silentlyreturning false.Closesnestjs#15055
@malkovitcmalkovitcforce-pushed thefix/optional-metadata-inheritance branch fromf102a01 toc97b2ceCompareDecember 17, 2025 09:40
@malkovitcmalkovitc changed the titlefix(core,common): prevent @Optional inheritance and improve FileTypeValidator errorsfix(common): improve error handling in FileTypeValidatorDec 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@malkovitc@coveralls@kamilmysliwiec

[8]ページ先頭

©2009-2025 Movatter.jp