Skip to content

Commit 41c7d2b

Browse files
authored
fix(windows): resolve react-native-windows path before using it (#2610)
1 parent a7a5897 commit 41c7d2b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/helpers.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { equal, fail, notEqual } from "node:assert/strict";
2+
import * as fs from "node:fs";
23
import * as path from "node:path";
34
import { describe, it } from "node:test";
45
import { URL, fileURLToPath } from "node:url";
@@ -72,7 +73,7 @@ describe("requireTransitive()", () => {
7273

7374
const mustache = requireTransitive<typeof import("mustache")>(
7475
["@react-native-windows/cli", "mustache"],
75-
rnwDir
76+
fs.realpathSync(rnwDir)
7677
);
7778
notEqual(mustache, null);
7879
equal(typeof mustache.parse, "function");

windows/app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export async function generateSolution(destPath, options, fs = nodefs) {
203203
/** @type {typeof import("mustache")} */
204204
const mustache = requireTransitive(
205205
["@react-native-windows/cli", "mustache"],
206-
rnWindowsPath
206+
fs.realpathSync(rnWindowsPath)
207207
);
208208
const slnPath = path.join(destPath, `${info.bundle.appName}.sln`);
209209
const vcxprojPath = path.join(projectFilesDestPath, projectFileName);

0 commit comments

Comments
 (0)