Compile Failing (Used to work?)

I’m having trouble with the compiler using both the new and an old version of ChoiceScript. I tried CSW’s idea to check the log with f12 when trying to compile and got this:

Extracting js data from:
compile.html:17 version.js
compile.html:17 ../persist.js
compile.html:17 ../alertify.min.js
compile.html:17 ../util.js
compile.html:17 ../ui.js
compile.html:17 ../scene.js
compile.html:17 ../navigator.js
compile.html:17 ../ChoiceScriptSavePlugin.js
compile.html:17 mygame.js
compile.html:91 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'split')
    at slurpFileLines (compile.html:91:23)
    at generateMygame (mygamegenerator.js:121:15)
    at compile (compile.js:115:19)
    at compile.js:87:30

Anyone else having this issue? I figured maybe I had setup the save plugin wrong but when pulling up my archived folder of CS, which was working before, I’m getting the same issue.

While I can’t tell why compile.html is messing up for me now, I can confirm that run-compile.bat still worked fine.

1 Like

Yes, I had the exact same issue. Was pulling out my hair because I thought I was the only one! As you mentioned, run-compile.bat still worked.

2 Likes

Compiler isn’t working for me either. My game passes quick and random tests but the internet tab, when I run the compile.html displays this:

I can open the run-compile.bat, and it looks like it’s doing things, but I don’t know anything about anything. Can someone help me with the compile.html or run-compile.bat?

I was able to resolve this by downloading a fresh version of Choicescript on a Windows computer (I mostly use a Mac). The compile.html still didn’t work, but run-compile.html did, creating a file called “output.html” in the main Choicescript folder when I used Edge (Mozilla and Chrome did not work; nothing worked on Mac).

This is fixed now in the latest version of ChoiceScript, pushed today.

There are now three ways to run the compiler.

  1. Running a server with its runner script, and then clicking the “Export to HTML” link in the footer of the page.

    • On Windows, double-click on run-server.bat
    • On macOS, double-click on server.command

    This is what we document doing on the https://www.choiceofgames.com/choicescript page. (We document the “Export to HTML” link here: https://www.choiceofgames.com/make-your-own-games/exporting-and-publishing-your-game/)

  2. Double-clicking on a runner script for the compiler.

    • On Windows, double-click on run-compile.bat
    • On macOS, double-click on compile.command
  3. Double-clicking on compile.html. You’ll have to do a fake “upload” of your ChoiceScript folder, so it can access your other files.

    This third way was broken, but is now fixed. (This is the least convenient way to run the compiler, but it is the oldest way, so I guess a lot of people are still used to it.)

The other two ways worked before, and still work.

3 Likes