Problem
The assets.directory field in the generated wrangler.json uses OS-native path separators. On Windows, this produces backslash paths like ..\client instead of ../client.
This happens in getAssetsDirectory(), which calls nodePath.relative() without normalizing the result:
function getAssetsDirectory(workerOutputDirectory, resolvedViteConfig) {
const clientOutputDirectory = resolvedViteConfig.environments.client?.build.outDir;
return nodePath.relative(
nodePath.resolve(resolvedViteConfig.root, workerOutputDirectory),
nodePath.resolve(resolvedViteConfig.root, clientOutputDirectory)
);
}
path.relative() returns OS-native separators (\ on Windows), but wrangler.json is a platform-agnostic config file and should always use forward slashes.
Expected
{ "assets": { "directory": "../client" } }
Actual (on Windows)
{ "assets": { "directory": "..\\client" } }
Problem
The
assets.directoryfield in the generatedwrangler.jsonuses OS-native path separators. On Windows, this produces backslash paths like..\clientinstead of../client.This happens in
getAssetsDirectory(), which callsnodePath.relative()without normalizing the result:path.relative()returns OS-native separators (\on Windows), butwrangler.jsonis a platform-agnostic config file and should always use forward slashes.Expected
{ "assets": { "directory": "../client" } }Actual (on Windows)
{ "assets": { "directory": "..\\client" } }