Skip to content

Commit 2cfe7ba

Browse files
authored
fix(tests): handle unknown .jsx extension for TanStack solid dependencies (@ennajari) (#7806)
Fixes #7801 `@tanstack/solid-*` packages ship `.jsx` source files that Node.js cannot load without a JSX transform. **Fix:** Add `ssr.noExternal: ["@solidjs/meta", /@TanStack\/solid-.*/]` to all three test projects (unit, jsdom, jsx). This forces Vite to bundle and transform them through `vite-plugin-solid`. **Test plan** - pnpm vitest run completes without "Unknown file extension" errors - Tests importing `@tanstack/solid-*` packages run correctly
1 parent 0ab6c73 commit 2cfe7ba

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

frontend/vitest.config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ const plugins = [
99
solidPlugin({ hot: false }),
1010
];
1111

12+
const tanstackSolidNoExternal: (string | RegExp)[] = [
13+
"@solidjs/meta",
14+
/@tanstack\/solid-.*/,
15+
];
16+
1217
export const projects: UserWorkspaceConfig[] = [
1318
{
19+
ssr: {
20+
noExternal: tanstackSolidNoExternal,
21+
},
1422
test: {
1523
name: { label: "unit", color: "blue" },
1624
include: ["__tests__/**/*.spec.ts"],
@@ -26,6 +34,9 @@ export const projects: UserWorkspaceConfig[] = [
2634
plugins,
2735
},
2836
{
37+
ssr: {
38+
noExternal: tanstackSolidNoExternal,
39+
},
2940
test: {
3041
name: { label: "jsdom", color: "yellow" },
3142
include: ["__tests__/**/*.jsdom-spec.ts"],
@@ -36,7 +47,7 @@ export const projects: UserWorkspaceConfig[] = [
3647
},
3748
{
3849
ssr: {
39-
noExternal: ["@solidjs/meta"],
50+
noExternal: tanstackSolidNoExternal,
4051
},
4152
test: {
4253
name: { label: "jsx", color: "green" },

0 commit comments

Comments
 (0)