Warn when accessing locals during prerendering
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
A user on Discord needed days to solve a problem.
The reason for this was that some routes were prerendered, which the helpers on Discord were not aware of.
See #11981
Describe the proposed solution
Print a warning when accessing locals during prerendering.
This could lead to some false positives, as some store a database connection to event.locals which gets used to fetch content while prerendering. However, I think this is a minority.
Alternatives considered
Do nothing.
Importance
would make my life easier
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the prerendering flow and how event.locals is accessed during it; the issue provides no file or test path. Done means accesses to locals during prerendering produce a warning while the documented false-positive case remains understood and covered by appropriate tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100