Skip to content

Commit

Permalink
[docs] Clarify usage of page.query (#2910)
Browse files Browse the repository at this point in the history
* [docs] Clarify usage of `page.query`

* Update documentation/docs/03-loading.md

* Update documentation/docs/11-ssr-and-javascript.md

Co-authored-by: Rich Harris <hello@rich-harris.dev>
  • Loading branch information
adriandelgado and Rich-Harris authored Nov 25, 2021
1 parent c6b9ee4 commit cf3a8b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions documentation/docs/11-ssr-and-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ The basic rule is this: for a page to be prerenderable, any two users hitting it
Note that you can still prerender pages that load data based on the page's parameters, like our `src/routes/blog/[slug].svelte` example from earlier. The prerenderer will intercept requests made inside `load`, so the data served from `src/routes/blog/[slug].json.js` will also be captured.

Accessing [`page.query`](#loading-input-page) during prerendering is forbidden. If you need to use it, ensure you are only doing so in the browser (for example in `onMount`).

#### Route conflicts

Because prerendering writes to the filesystem, it isn't possible to have two endpoints that would cause a directory and a file to have the same name. For example, `src/routes/foo/index.js` and `src/routes/foo/bar.js` would try to create `foo` and `foo/bar`, which is impossible.
Expand Down

0 comments on commit cf3a8b5

Please sign in to comment.