diff --git a/sites/svelte.dev/src/routes/(authed)/repl/[id].json/+server.js b/sites/svelte.dev/src/routes/(authed)/repl/[id].json/+server.js index eba4833edf..13c52a2ef0 100644 --- a/sites/svelte.dev/src/routes/(authed)/repl/[id].json/+server.js +++ b/sites/svelte.dev/src/routes/(authed)/repl/[id].json/+server.js @@ -10,8 +10,6 @@ export const prerender = 'auto'; const UUID_REGEX = /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/; -const examples_data = get_examples_data(); - /** @type {Set} */ let examples; @@ -42,6 +40,7 @@ export async function GET({ params }) { // We prerender examples pages during build time. That means, when something like `/repl/hello-world.json` // is accessed, this function won't be run at all, as it will be served from the filesystem if (building || dev) { + const examples_data = get_examples_data(); examples = new Set( get_examples_list(examples_data) .map((category) => category.examples)