Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tame-horses-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Work around SSR transform bug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { invalid } from '@sveltejs/kit';
import { answers, allowed } from './words.server';
import { words, allowed } from './words.server';
import type { PageServerLoad, Actions } from './$types';

/** @type {import('./$types').PageServerLoad} */
Expand Down Expand Up @@ -88,12 +88,12 @@ class Game {
this.guesses = guesses ? guesses.split(' ') : [];
this.answers = answers ? answers.split(' ') : [];
} else {
this.index = Math.floor(Math.random() * answers.length);
this.index = Math.floor(Math.random() * words.length);
this.guesses = ['', '', '', '', '', ''];
this.answers = /** @type {string[]} */ [] /***/;
}

this.answer = answers[this.index];
this.answer = words[this.index];
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** The list of possible answers */
export const answers = [
/** The list of possible words */
export const words = [
'aback',
'abase',
'abate',
Expand Down Expand Up @@ -2317,9 +2317,9 @@ export const answers = [
'zonal'
];

/** The list of valid guesses, of which the list of possible answers is a subset */
/** The list of valid guesses, of which the list of possible words is a subset */
export const allowed = new Set([
...answers,
...words,
'aahed',
'aalii',
'aargh',
Expand Down