-
Notifications
You must be signed in to change notification settings - Fork 774
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: apply source mapping to deployment validation errors #4600
Conversation
🦋 Changeset detectedLatest commit: 4ad7a7a 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 |
6d9afd3
to
86bc516
Compare
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/7387305238/npm-package-wrangler-4600 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7387305238/npm-package-wrangler-4600 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7387305238/npm-package-wrangler-4600 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7387305238/npm-package-miniflare-4600 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7387305238/npm-package-cloudflare-pages-shared-4600 npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7387305238/npm-package-create-cloudflare-4600 --no-auto-update Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
0fd9b75
to
fac2f99
Compare
86bc516
to
787cbfa
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4600 +/- ##
==========================================
+ Coverage 75.46% 75.55% +0.08%
==========================================
Files 242 242
Lines 12957 13074 +117
Branches 3331 3367 +36
==========================================
+ Hits 9778 9878 +100
- Misses 3179 3196 +17
|
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.
I know it is quite awkward but we might need to construct some actual source and compiled files, with source maps that can act as additional modules, etc so that we can cover the missing code-paths in tests.
Rename `RetrieveSourceMap` to `RetrieveSourceMapFunction`
Add comment highlighting why `retrieveSourceMapOverride` module level
Add tests for different types of modules/source maps
I've added tests for the missing code paths in 6653a30 🙂 |
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.
Magic!
Use `dedent` with multiline template literals
Use correct variable name in error
Fixes #2741.
What this PR solves / how to test:
Previously if a Worker failed validation during
wrangler deploy
, the displayed error would reference locations in built JavaScript files. This made it more difficult to debug validation errors. This change ensures these errors are now source mapped, referencing locations in source files instead. To test this, try to deploy a TypeScript worker referencing a non-existent variable in the global scope. The validation error should include the location in the TypeScript file.Author has addressed the following:
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.