Skip to content

Commit 7163571

Browse files
committed
fix: fix for #1307
This fixes a new issue introduced with Bazel 1.0.0 where Bazel adds a `{workspace}/.runfile` to the runfiles MANIFEST and this messes with the node_loader resolve logic on Windows.
1 parent 99f16b0 commit 7163571

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

internal/node/node_loader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ function loadRunfilesManifest(manifestPath) {
128128
// We don't need to try determining the local workspace path for the current runfile
129129
// mapping in case we already determined the local workspace path, the current
130130
// runfile refers to a different workspace, or the current runfile resolves to a file
131-
// in the bazel-out directory (bin/genfiles directory).
132-
if (localWorkspacePath || !runfilesPath.startsWith(USER_WORKSPACE_NAME) ||
131+
// in the bazel-out directory (bin/genfiles directory). Also exclude the case of no
132+
// realpath which fixes https://github.com/bazelbuild/rules_nodejs/issues/1307.
133+
if (localWorkspacePath || !runfilesPath.startsWith(USER_WORKSPACE_NAME) || !realPath ||
133134
realPath.startsWith(outputBase)) {
134135
continue;
135136
}

0 commit comments

Comments
 (0)