Skip to content

Commit 722edd1

Browse files
justin808claude
andcommitted
Fix TypeScript errors from bundlePath to serverBundleCachePath rename in Pro package
Following the rename in the main package, update the Pro package's node-renderer to use serverBundleCachePath consistently: 1. configBuilder.ts: Add null check when using deprecated bundlePath as fallback 2. vm.ts: Use serverBundleCachePath instead of bundlePath for debug file paths These changes fix TypeScript compilation errors where bundlePath (optional) was being used where a string was required. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5f7a382 commit 722edd1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

react_on_rails_pro/packages/node-renderer/src/shared/configBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ export function buildConfig(providedUserConfig?: Partial<Config>): Config {
257257
);
258258
// If serverBundleCachePath is not set, use bundlePath as fallback
259259
if (
260-
!config.serverBundleCachePath ||
261-
config.serverBundleCachePath === defaultConfig.serverBundleCachePath
260+
userConfig.bundlePath &&
261+
(!config.serverBundleCachePath || config.serverBundleCachePath === defaultConfig.serverBundleCachePath)
262262
) {
263263
config.serverBundleCachePath = userConfig.bundlePath;
264264
}

react_on_rails_pro/packages/node-renderer/src/worker/vm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export async function runInVM(
112112
filePath: string,
113113
vmCluster?: typeof cluster,
114114
): Promise<RenderResult> {
115-
const { bundlePath } = getConfig();
115+
const { serverBundleCachePath } = getConfig();
116116

117117
try {
118118
// Wait for VM creation if it's in progress
@@ -137,7 +137,7 @@ export async function runInVM(
137137
const workerId = vmCluster?.worker?.id;
138138
log.debug(`worker ${workerId ? `${workerId} ` : ''}received render request for bundle ${filePath} with code
139139
${smartTrim(renderingRequest)}`);
140-
const debugOutputPathCode = path.join(bundlePath, 'code.js');
140+
const debugOutputPathCode = path.join(serverBundleCachePath, 'code.js');
141141
log.debug(`Full code executed written to: ${debugOutputPathCode}`);
142142
await writeFileAsync(debugOutputPathCode, renderingRequest);
143143
}
@@ -165,7 +165,7 @@ ${smartTrim(renderingRequest)}`);
165165
if (log.level === 'debug') {
166166
log.debug(`result from JS:
167167
${smartTrim(result)}`);
168-
const debugOutputPathResult = path.join(bundlePath, 'result.json');
168+
const debugOutputPathResult = path.join(serverBundleCachePath, 'result.json');
169169
log.debug(`Wrote result to file: ${debugOutputPathResult}`);
170170
await writeFileAsync(debugOutputPathResult, result);
171171
}

0 commit comments

Comments
 (0)