fix(tests): handle unknown .jsx extension for TanStack solid dependencies (@ennajari)#7806
Open
ennajari wants to merge 1 commit intomonkeytypegame:masterfrom
Open
fix(tests): handle unknown .jsx extension for TanStack solid dependencies (@ennajari)#7806ennajari wants to merge 1 commit intomonkeytypegame:masterfrom
ennajari wants to merge 1 commit intomonkeytypegame:masterfrom
Conversation
…cies @tanstack/solid-store and related packages ship .jsx source files. Vitest cannot load these directly in Node.js without a JSX transform. Add all @tanstack/solid-* packages to deps.optimizer.web.include so Vite pre-bundles them through its transform pipeline (including vite-plugin-solid), and to ssr.noExternal in the jsx project so they are also bundled in the SSR-like Node.js module loading context. Fixes monkeytypegame#7801
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.
Summary
Fixes #7801
@tanstack/solid-store(and related@tanstack/solid-*packages) ship.jsxsource files in theirdist/source/directory. When vitest tries to load these in a Node.js context, it throws:Root cause: vitest loads these packages outside of Vite's transform pipeline, so
vite-plugin-solid's JSX transform never runs on them.Fix: Register all
@tanstack/solid-*packages in two places:deps.optimizer.web.include— pre-bundles them through Vite's pipeline (covershappy-dom/jsdomenvironments)ssr.noExternalin thejsxproject — ensures they are also bundled in the SSR-like Node.js module loading context used for.spec.tsxtestsTest plan
pnpm vitest runcompletes withoutUnknown file extension ".jsx"errors@tanstack/solid-storeor any@tanstack/solid-*package run correctly