{{ message }}
Studio: make the mmproj fallback import resolvable under node's type stripping - #9181
Closed
danielhanchen wants to merge 1 commit into
Closed
Studio: make the mmproj fallback import resolvable under node's type stripping#9181danielhanchen wants to merge 1 commit into
danielhanchen wants to merge 1 commit into
Conversation
…stripping tests/queued-model-capabilities.test.ts imports image-input-support.ts directly, and that file imports ./mmproj-fallback without an extension. Node's --experimental-strip-types does not do extension resolution, so the whole test file dies with ERR_MODULE_NOT_FOUND rather than failing an assertion. The import only became reachable from a node test when getImageInputUnavailableReason was added to that test's imports, which is why it surfaced now. 46 imports under src/ already carry an explicit .ts for the same reason.
This was referenced Aug 18, 2026
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

npm testis red onmainright now.tests/queued-model-capabilities.test.tsdoes not fail an assertion, it dies on module resolution, so the whole file's 4 tests never run.The file it cannot find is there. The problem is the extension:
image-input-support.tsimports./mmproj-fallbackwith none, and Node's--experimental-strip-typesdoes not do extension resolution, so it looks for a file called exactlymmproj-fallbackand gives up.That import has been extensionless for a while without anyone noticing, because nothing reached it from a Node test. It became reachable when
getImageInputUnavailableReasonwas added totests/queued-model-capabilities.test.ts's imports in #9173, which is why it surfaces only now.Reproduced on a clean checkout of
mainat077593612with nothing else applied:npm testreports✖ tests/queued-model-capabilities.test.ts, and running that file alone gives theERR_MODULE_NOT_FOUNDabove.tests 4, pass 4, fail 0.The fix is the extension. There are already 46 imports under
src/carrying an explicit.tsfor exactly this reason, so this follows what is there rather than introducing a new convention. The alternative, making the test import the module dynamically the waytests/delete-chat-files-preference.test.tsdoes, would work too but changes a test to accommodate a source file rather than the other way round.No new test is needed here:
tests/queued-model-capabilities.test.tsis itself the guard. It is red without this change and green with it, which is how I verified the fix rather than assuming it.Found while resolving #9058 against
main. It is not that PR's, so it is not being fixed inside it.