diff --git a/packages/vite/src/buildRscFeServer.ts b/packages/vite/src/buildRscFeServer.ts index 0f36a4837e12..a4a46d08d71f 100644 --- a/packages/vite/src/buildRscFeServer.ts +++ b/packages/vite/src/buildRscFeServer.ts @@ -102,8 +102,18 @@ export const buildRscFeServer = async ({ 'moduleIds' in item && item.moduleIds.includes(clientEntryFiles[name] as string) )?.fileName + if (entryFile) { - clientEntries[entryFile] = fileName + console.log('entryFile', entryFile) + if (process.platform === 'win32') { + const entryFileSlash = entryFile.replaceAll('\\', '/') + console.log('entryFileSlash', entryFileSlash) + // Prevent errors on Windows like + // Error: No client entry found for D:/a/redwood/rsc-project/web/dist/server/assets/rsc0.js + clientEntries[entryFileSlash] = fileName + } else { + clientEntries[entryFile] = fileName + } } } diff --git a/packages/vite/src/waku-lib/rsc-handler-worker.ts b/packages/vite/src/waku-lib/rsc-handler-worker.ts index c1e1cb7d0617..e0fef6b20824 100644 --- a/packages/vite/src/waku-lib/rsc-handler-worker.ts +++ b/packages/vite/src/waku-lib/rsc-handler-worker.ts @@ -259,8 +259,9 @@ export async function setClientEntries( } const config = await configPromise const entriesFile = await getEntriesFile(config, false) - console.log('entriesFile', entriesFile) + console.log('setClientEntries :: entriesFile', entriesFile) const { clientEntries } = await loadServerFile(entriesFile) + console.log('setClientEntries :: clientEntries', clientEntries) if (!clientEntries) { throw new Error('Failed to load clientEntries') } @@ -272,7 +273,10 @@ export async function setClientEntries( ]) ) - console.log('absoluteClientEntries', absoluteClientEntries) + console.log( + 'setClientEntries :: absoluteClientEntries', + absoluteClientEntries + ) } export async function renderRSC(input: RenderInput): Promise {