-
Notifications
You must be signed in to change notification settings - Fork 741
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
Fix dynamic chunk loading on wrangler pages dev
for _worker.js/
directory
#3175
Conversation
🦋 Changeset detectedLatest commit: 574561d 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 |
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/4981081436/npm-package-wrangler-3175 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/3175/npm-package-wrangler-3175 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4981081436/npm-package-wrangler-3175 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4981081436/npm-package-cloudflare-pages-shared-3175 Note that these links will no longer work once the GitHub Actions artifact expires. |
Codecov Report
@@ Coverage Diff @@
## main #3175 +/- ##
==========================================
- Coverage 74.62% 74.59% -0.03%
==========================================
Files 179 179
Lines 10926 11031 +105
Branches 2908 2934 +26
==========================================
+ Hits 8153 8229 +76
- Misses 2773 2802 +29
|
packages/wrangler/src/bundle.ts
Outdated
@@ -457,16 +459,18 @@ export async function bundleWorker( | |||
entryPointOutputs[0][0] | |||
); | |||
|
|||
const modules = [...additionalModules, ...moduleCollector.modules]; |
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.
Is it possible that additionalModules
and moduleCollector.modules
contain duplicates?
Do we care? Probably not here, since all we are doing is writing them out to the directory containing the entry-point, so we just waste some time writing files more than once.
But this modules
array is returned and could that result in multiple copies of the same file being added to an HTTP Form?
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.
HTTP form defaults automatically de-dupes by preferring the last entry. Workerd crashed. I added this commit to more gracefully handle the unlikely case of a collision: 742dee4
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.
There is a test! It was previously erroneously passing.
So despite there being annotations about code coverage this is actually checked by that test.
We do need a changeset though!
Pete already asked for it, sorry I missed that 🙈 |
5ca3244
to
9251a83
Compare
…'wrangler pages dev'
9251a83
to
0821ad1
Compare
Fixes #3148.
What this PR solves / how to test:
Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable: