Make sure that the correct entrypoint file path is applied when bundling Pages applications#4676
Make sure that the correct entrypoint file path is applied when bundling Pages applications#4676dario-piotrowicz merged 3 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 96634f3 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/7493808436/npm-package-wrangler-4676You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7493808436/npm-package-wrangler-4676Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7493808436/npm-package-wrangler-4676 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7493808436/npm-package-miniflare-4676npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7493808436/npm-package-cloudflare-pages-shared-4676npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7493808436/npm-package-create-cloudflare-4676 --no-auto-updateNote that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4676 +/- ##
==========================================
+ Coverage 75.60% 75.71% +0.11%
==========================================
Files 243 243
Lines 13096 13210 +114
Branches 3376 3393 +17
==========================================
+ Hits 9901 10002 +101
- Misses 3195 3208 +13
|
petebacondarwin
left a comment
There was a problem hiding this comment.
I think that entry.file should already be resolved by the time we hit this code.
In most cases it is. From looking up the call stack I think the problem is in packages/wrangler/src/pages/dev.ts: if the working directory is not defined then the script-path (aka singleWorkerScriptPath) is used without resolving it correctly.
7bd057d to
2dd517b
Compare
|
Thanks a bunch @petebacondarwin 🙂 I've applied the change in the |
e9ded02 to
cc410e7
Compare
cc410e7 to
8cbf595
Compare
There was a problem hiding this comment.
I tested this locally by checking out the PR and running the following in the pages-dev-proxy-with-script fixture:
pnpm wrangler pages dev --proxy=9999 --script-path=custom/script/path/index.js
This fails with an error without the fix and works after the fix.
Fixes #4652