diff --git a/packages/plugin-rsc/e2e/react-router.test.ts b/packages/plugin-rsc/e2e/react-router.test.ts index 9a8f6e785..01637fb58 100644 --- a/packages/plugin-rsc/e2e/react-router.test.ts +++ b/packages/plugin-rsc/e2e/react-router.test.ts @@ -1,8 +1,8 @@ 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' +import { readFileSync } from 'node:fs' test.describe('dev-default', () => { const f = useFixture({ root: 'examples/react-router', mode: 'dev' }) @@ -74,8 +74,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)