-
Notifications
You must be signed in to change notification settings - Fork 747
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
Create a custom not-found edge route for next applications using the app router #4625
Conversation
🦋 Changeset detectedLatest commit: cf26143 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/7408676904/npm-package-wrangler-4625 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7408676904/npm-package-wrangler-4625 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7408676904/npm-package-wrangler-4625 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7408676904/npm-package-miniflare-4625 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7408676904/npm-package-cloudflare-pages-shared-4625 npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7408676904/npm-package-create-cloudflare-4625 --no-auto-update Note 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 #4625 +/- ##
==========================================
+ Coverage 75.41% 75.67% +0.25%
==========================================
Files 242 243 +1
Lines 12965 13095 +130
Branches 3337 3375 +38
==========================================
+ Hits 9778 9909 +131
+ Misses 3187 3186 -1 |
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.
Let's move the error handling out of probePaths()
.
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.
Cool!
This PR generates a
not-found
custom edge route for users creating next-on-pages applications that use the app router.Having such route is not mandatory but it helps avoiding a gotcha that can trip people over: https://github.com/cloudflare/next-on-pages/blob/56391355c3028737a4b0069a5126ccaec24e53b1/packages/next-on-pages/docs/gotchas.md#not-found