Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/dashboard/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
fullyParallel: true,
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
reporter: process.env.CI ? [["list"], ["github"]] : [["list"]],
// "html" writes playwright-report/, which the e2e workflow uploads as an artifact on
// failure — without it a red nightly run leaves nothing to debug from.
reporter: process.env.CI ? [["list"], ["github"], ["html", { open: "never" }]] : [["list"]],
retries: process.env.CI ? 2 : 0,
testDir: "./e2e",
timeout: 60_000,
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
"eslint-plugin-storybook": "^9.1.4",
"husky": ">=6",
"jsdom": "26",
"lightningcss": "^1.32.0",
"lint-staged": ">=10",
"msw": "^2.14.6",
"prettier": "catalog:",
Expand Down
4 changes: 3 additions & 1 deletion apps/frontend/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
fullyParallel: true,
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
reporter: process.env.CI ? [["list"], ["github"]] : [["list"]],
// "html" writes playwright-report/, which the e2e workflow uploads as an artifact on
// failure — without it a red nightly run leaves nothing to debug from.
reporter: process.env.CI ? [["list"], ["github"], ["html", { open: "never" }]] : [["list"]],
retries: process.env.CI ? 2 : 0,
testDir: "./e2e",
timeout: 60_000,
Expand Down
29 changes: 29 additions & 0 deletions apps/frontend/src/tests/vite-single-instance.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { realpathSync } from "node:fs";
import { createRequire } from "node:module";
import { describe, expect, it } from "vitest";

// TanStack Start decides whether to install its SSR dev middleware with
// `isRunnableDevEnvironment(env)`, which is an `instanceof` check. If the plugin resolves a
// different copy of Vite than the one that created the dev server, that check silently fails,
// the middleware is never installed and every dev route falls through to a 404 — the app is
// unreachable locally and the Playwright webServer never becomes ready.
//
// Bun installs a separate copy of Vite per resolved optional-peer set, so this breaks as soon
// as the app and the plugin disagree on one of them (`lightningcss` is why the frontend depends
// on it directly). Compare the resolved module paths rather than trusting the version alone.
const require = createRequire(import.meta.url);

function resolveViteFrom(requirer: NodeRequire): string {
return realpathSync(requirer.resolve("vite"));
}

describe("Vite module identity", () => {
it("resolves the same Vite copy for the app and for the TanStack Start plugin", () => {
const appVite = resolveViteFrom(require);

const reactStart = createRequire(require.resolve("@tanstack/react-start/package.json"));
const startPlugin = createRequire(reactStart.resolve("@tanstack/start-plugin-core/package.json"));

expect(resolveViteFrom(startPlugin)).toBe(appVite);
});
});
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading