From b2b9276b6e9142637f85e0184e4ddc6ef28e787a Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Sat, 12 Jul 2025 15:14:42 +0900 Subject: [PATCH 1/2] test(rsc): fix ssr modulepreload link test --- packages/plugin-rsc/e2e/react-router.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/plugin-rsc/e2e/react-router.test.ts b/packages/plugin-rsc/e2e/react-router.test.ts index 9a8f6e785..8c733f9b6 100644 --- a/packages/plugin-rsc/e2e/react-router.test.ts +++ b/packages/plugin-rsc/e2e/react-router.test.ts @@ -3,6 +3,7 @@ import path from 'node:path' import { expect, test } from '@playwright/test' import { type Fixture, useFixture } from './fixture' import { expectNoReload, testNoJs, waitForHydration } from './helper' +import { readFileSync } from 'node:fs' test.describe('dev-default', () => { const f = useFixture({ root: 'examples/react-router', mode: 'dev' }) @@ -74,8 +75,11 @@ function defineTest(f: Fixture) { .evaluateAll((elements) => elements.map((el) => el.getAttribute('href')), ) - const { default: manifest } = await import( - path.resolve(f.root, 'dist/ssr/__vite_rsc_assets_manifest.js') + const manifest = JSON.parse( + readFileSync( + f.root + '/dist/ssr/__vite_rsc_assets_manifest.js', + 'utf-8', + ).slice('export default '.length), ) const hashString = (v: string) => createHash('sha256').update(v).digest().toString('hex').slice(0, 12) From 1ce72b73d973f98a76dd6d92cc904969b3e6fc77 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Sat, 12 Jul 2025 15:19:04 +0900 Subject: [PATCH 2/2] chore: unused --- packages/plugin-rsc/e2e/react-router.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/plugin-rsc/e2e/react-router.test.ts b/packages/plugin-rsc/e2e/react-router.test.ts index 8c733f9b6..01637fb58 100644 --- a/packages/plugin-rsc/e2e/react-router.test.ts +++ b/packages/plugin-rsc/e2e/react-router.test.ts @@ -1,5 +1,4 @@ import { createHash } from 'node:crypto' -import path from 'node:path' import { expect, test } from '@playwright/test' import { type Fixture, useFixture } from './fixture' import { expectNoReload, testNoJs, waitForHydration } from './helper'