[pull] canary from vercel:canary#1048
Merged
Merged
Conversation
## What
When a user writes `Date()` or `new Date()` in a Server Component and
instant validation surfaces a sync IO error, the dev overlay incorrectly
labels the cause as `Date.now()`.
```tsx
return <p>{new Date().toString()}</p>
```
Overlay headline says: `Next.js encountered Date.now() without an
explicit rendering intent.`
## Why
`getBlockingRouteErrorDetails` in `errors.tsx` classifies the API by
scanning the error message with `String.prototype.includes` against
`SYNC_IO_APIS` in order, first match wins. The time-type factory always
embeds `Date.now()` in the `elapsedTimeBullet` text (`Measure elapsed
time with \`performance.now()\` instead of \`Date.now()\``) regardless
of which API the user called. Because `Date.now()` was first in the
array, it matched the bullet text and shadowed the real expression.
Fix: put `new Date()` and `Date()` before `Date.now()` so the
more-specific entries win when both appear in the message.
User-visible cards and docs URL are unaffected — all three time variants
map to the same card set — only the cause label was wrong.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
…em (#93856) Adds `metadata.internal: true` to all 12 `.agents/skills/*/SKILL.md` files so external `npx skills add /path/to/next.js` no longer lists Next.js framework-dev skills — only `next-compile` remains visible. <!-- NEXT_JS_LLM_PR -->
…free (#93858) When an error prevents validation from happening that same error likely shows up in the main dev render. To avoid double reporting in dev we silence notices about validation being incomplete if the main render has errors to report to the user. If no user facing errors exist then we will report the lack of validation as it's own issue to confront.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )