-
Notifications
You must be signed in to change notification settings - Fork 736
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wrangler] fix: store temporary files in .wrangler
#4127
Conversation
🦋 Changeset detectedLatest commit: 90e3a12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
.wrangler
.wrangler
a52f568
to
665f371
Compare
Previously, Wrangler used the OS's default temporary directory. On Windows, this is usually on the `C:` drive. If your source code was on a different drive, `esbuild` would generate invalid source maps (source paths relative to the cwd were used verbatim in the output, rather than being relative to sources root and the source map location), breaking breakpoint debugging in VSCode. This change ensures intermediate files are always written to the same drive as sources. It also ensures unused bundle outputs are cleaned up between `wrangler pages dev` reloads, and the same file path is used for writing functions routes. Closes #4052
665f371
to
90e3a12
Compare
Codecov Report
@@ Coverage Diff @@
## main #4127 +/- ##
==========================================
+ Coverage 75.31% 75.40% +0.08%
==========================================
Files 223 223
Lines 12191 12227 +36
Branches 3151 3160 +9
==========================================
+ Hits 9182 9220 +38
+ Misses 3009 3007 -2
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6431012321/npm-package-wrangler-4127 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6431012321/npm-package-wrangler-4127 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6431012321/npm-package-wrangler-4127 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6431012321/npm-package-cloudflare-pages-shared-4127 Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tentatively looks good, but I'd love to test it on Windows first next week
@mrbbot I can confirm this fixed it for me, I had my repository on my Windows DevDrive (D:) and breakpoints would not hit, even if I did it via my mounted C: symlink ($HOME/Projects). After installing this wrangler, seems to be fine. Thank you! This was driving me crazy that I had done something wrong. |
Fixes #4052
What this PR solves / how to test:
Previously, Wrangler used the OS's default temporary directory. On Windows, this is usually on the
C:
drive. If your source code was on a different drive,esbuild
would generate invalid source maps (source paths relative to the cwd were used verbatim in the output, rather than being relative to sources root and the source map location), breaking breakpoint debugging in VSCode. This change ensures intermediate files are always written to the same drive as sources. It also ensures unused bundle outputs are cleaned up betweenwrangler pages dev
reloads, and the same file path is used for writing functions routes.To test, create a new Wrangler project using Windows on a non-
C:
drive. Try to set a breakpoint using VSCode. You should be able to hit it. 🎉Associated docs issue(s)/PR(s):
N/A
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr review
so future reviewers can take inspiration and learn from it.