Conversation
require.resolve({ paths }) walks up parent directories, finding
packages in ancestor node_modules that esbuild's nodePaths cannot
reach. This skipped installs for deps like cheerio, causing
"Could not resolve" build failures in production.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Coverage Report for CI Build 26303777067Warning No base build found for commit Coverage: 95.215%Details
Uncovered Changes
Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
require.resolve({ paths }) walks up parent directories, finding packages in ancestor node_modules that esbuild's nodePaths cannot reach. This skipped installs for deps like cheerio, causing "Could not resolve" build failures in production.
Note
Medium Risk
Changes dependency-install skipping logic based on direct filesystem checks in
nodePaths, which can affect whether packages are installed or reused and may impact build reliability in environments with custom module layouts.Overview
Fixes dependency detection when
nodePathsare provided by checking forpackage.jsondirectly under each configurednodePathsentry instead of usingrequire.resolve({ paths }), preventing false positives from ancestornode_modulestraversal thatesbuildwon’t honor.Adds a regression test that simulates a deep
nodePathsdirectory with a conflicting parentnode_modules, ensuring missing deps are installed intotmpdirrather than incorrectly skipped.Reviewed by Cursor Bugbot for commit e43cb84. Bugbot is set up for automated code reviews on this repo. Configure here.