diff --git a/build-tools/update b/build-tools/update
index f0fa607c4..d76721b33 100755
--- a/build-tools/update
+++ b/build-tools/update
@@ -107,20 +107,24 @@ compiledFiles += compiler.compileToDir(`replay.pokemonshowdown.com/src`, `replay
compiledFiles += compiler.compileToDir(`teams.pokemonshowdown.com/src`, `teams.pokemonshowdown.com/js`, compileOpts);
-compiledFiles += compiler.compileToFile(
- [
- 'play.pokemonshowdown.com/src/battle-dex.ts',
- 'play.pokemonshowdown.com/src/battle-dex-data.ts',
- 'play.pokemonshowdown.com/src/battle-log.ts',
- 'play.pokemonshowdown.com/src/battle-log-misc.js',
- 'caches/pokemon-showdown/server/chat-formatter.ts',
- 'play.pokemonshowdown.com/data/text.js',
- 'play.pokemonshowdown.com/data/text-afd.js',
- 'play.pokemonshowdown.com/src/battle-text-parser.ts',
- ],
- 'play.pokemonshowdown.com/js/battledata.js',
- compileOpts
-);
+try {
+ fs.statSync('play.pokemonshowdown.com/data/text.js');
+ // text.js exists, we can compile battledata
+ compiledFiles += compiler.compileToFile(
+ [
+ 'play.pokemonshowdown.com/src/battle-dex.ts',
+ 'play.pokemonshowdown.com/src/battle-dex-data.ts',
+ 'play.pokemonshowdown.com/src/battle-log.ts',
+ 'play.pokemonshowdown.com/src/battle-log-misc.js',
+ 'caches/pokemon-showdown/server/chat-formatter.ts',
+ 'play.pokemonshowdown.com/data/text.js',
+ 'play.pokemonshowdown.com/data/text-afd.js',
+ 'play.pokemonshowdown.com/src/battle-text-parser.ts',
+ ],
+ 'play.pokemonshowdown.com/js/battledata.js',
+ compileOpts
+ );
+} catch {}
if (!compileOpts.ignore) {
compiledFiles += compiler.compileToFile(
diff --git a/play.pokemonshowdown.com/testclient.html b/play.pokemonshowdown.com/testclient.html
index 2e128b7b5..17f1e02f6 100644
--- a/play.pokemonshowdown.com/testclient.html
+++ b/play.pokemonshowdown.com/testclient.html
@@ -16,7 +16,7 @@
-
+
-
+
diff --git a/replay.pokemonshowdown.com/testclient.html b/replay.pokemonshowdown.com/testclient.html
index af510bff6..ddb9f3282 100644
--- a/replay.pokemonshowdown.com/testclient.html
+++ b/replay.pokemonshowdown.com/testclient.html
@@ -143,7 +143,7 @@
-
+