Conversation
In deployed environments, process.cwd() may not be the project root (e.g., when the start script does `cd .amplify-hosting/compute/default/ && node app.js`). This adds findProjectRoot() which walks up from cwd looking for tsconfig.json to find the real project root. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When compiled JS is relocated (e.g., postbuild copies dist/ to a deployment directory), source map relative paths resolve to wrong absolute paths. This extracts the src/-relative portion from the stack trace path and reconstructs it using the real project root found via tsconfig.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Inside WSL, absolute paths like /home/user/project/... can't be resolved from Windows-side tooling (dashboards, VS Code terminal). This detects the WSL_DISTRO_NAME env var and prefixes resolved paths with //wsl.localhost/<distro> to make them accessible from Windows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
63ab960 to
e925523
Compare
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.
Summary
path.tsmodule to typeorm package withfindProjectRoot,resolveFilePath, andapplyWslPrefixutilities (mirroring existing mikroorm implementation)traceCallerto resolve source-map paths against the real project root instead of the deployment directoryTest plan