Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.2k
fix(deploy): preserve relative paths to linked internal dependencies#9677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
NotesResults of the
The bug was suspected to be caused by the following lines: projectDir:(options.currentDepth>0&&!wantedDependency.bareSpecifier.startsWith('file:')) ?ctx.lockfileDir :options.parentPkg.rootDir, But adding I added another modification to diff --git a/pkg-manager/resolve-dependencies/src/resolvePeers.ts b/pkg-manager/resolve-dependencies/src/resolvePeers.tsindex 07830ddd1..6bb42549a 100644--- a/pkg-manager/resolve-dependencies/src/resolvePeers.ts+++ b/pkg-manager/resolve-dependencies/src/resolvePeers.ts@@ -387,7 +387,7 @@ async function resolvePeersOfNode<T extends PartialResolvedPackage> ( } ): Promise<PeersResolution & { finishing?: FinishingResolutionPromise, calculateDepPath?: CalculateDepPath }> { const node = ctx.dependenciesTree.get(nodeId)!- if (node.depth === -1) return { resolvedPeers: new Map<string, NodeId>(), missingPeers: new Map<string, MissingPeerInfo>() }+ if (!node || node.depth === -1) return { resolvedPeers: new Map<string, NodeId>(), missingPeers: new Map<string, MissingPeerInfo>() } const resolvedPackage = node.resolvedPackage as T if ( ctx.purePkgs.has(resolvedPackage.pkgIdWithPatchHash) &&
I injected const_resolve=path.resolvepath.resolve=(...paths:string[])=>{constlast=paths.at(-1)!if(paths.length>1&&(last==='c'||last.endsWith('/c'))&&!paths.at(-2)?.endsWith('node_modules')&&paths.at(-2)!=='a'&&!paths.at(-2)?.endsWith('/a')){console.trace('PATH RESOLVE',paths)}return_resolve(...paths)} This trace appears (also in the file
I investigated for(constnodeofObject.values(graph)){constpkgSnapshot=lockfile.packages![node.depPath]constallDeps={ ...pkgSnapshot.dependencies, ...(opts.include.optionalDependencies ?pkgSnapshot.optionalDependencies :{}),}constpeerDeps=pkgSnapshot.peerDependencies ?newSet(Object.keys(pkgSnapshot.peerDependencies)) :nullnode.children=_getChildrenPaths(allDeps,peerDeps,'.')} It turns out that Seeing that it would take far more effort than initially estimated to fix this bug, I decided to abandon this. The above notes may be helpful for anyone who wants to continue. |
Uh oh!
There was an error while loading.Please reload this page.
Fixes#9575