torrust / torrust-website

Public Website for Torrust Organisation
https://torrust.com
GNU General Public License v3.0
1 stars 2 forks source link

Build error: `The following routes were marked as prerenderable ...` #4

Closed josecelano closed 1 month ago

josecelano commented 1 month ago

Hi @grmbyrn the page can't be built for production with:

npm run build

This is the error:

node:internal/event_target:1100
  process.nextTick(() => { throw err; });
                           ^
Error: The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:
  - /(pages)/index

See https://kit.svelte.dev/docs/page-options#prerender-troubleshooting for info on how to solve this
    at prerender (file:///home/josecelano/Documents/git/committer/me/github/torrust/torrust-website-v2/node_modules/@sveltejs/kit/src/core/postbuild/prerender.js:505:9)
    at async MessagePort.<anonymous> (file:///home/josecelano/Documents/git/committer/me/github/torrust/torrust-website-v2/node_modules/@sveltejs/kit/src/utils/fork.js:22:16)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:326:10)
    at [kOnMessage] (node:internal/worker:337:37)
    at MessagePort.<anonymous> (node:internal/worker:232:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)

Node.js v20.12.2
josecelano commented 1 month ago

Hi @grmbyrn I've just changed the path from "index" to "torrent-index" in the URL and it works. I don't know why. There must be a problem using "index" for a page. Anyway, "torrent-index" could be even better from the SEO perspective.

grmbyrn commented 1 month ago

Hi @grmbyrn I've just changed the path from "index" to "torrent-index" in the URL and it works. I don't know why. There must be a problem using "index" for a page. Anyway, "torrent-index" could be even better from the SEO perspective.

Hi @josecelano That's great. I looked it up and it seems that SK associates 'index' as the root path '/' and prerenders it in an incorrect way. Good to know for the future.