y-lohse / inkjs

A javascript port of inkle's ink scripting language.
http://www.inklestudios.com/ink/
MIT License
507 stars 104 forks source link

[Compiler] On compilation error you only get "Error: Compilation failed." message. #1080

Closed Pyblo closed 1 day ago

Pyblo commented 2 months ago

Describe the bug

When compiling a bugged .ink file using npx inkjs-compiler, you only get a message: Error: Compilation failed. I am using inkjs to create stories on my mobile phone using Termux and it would be super helpfull if compiler was able to output proper error mesages like in Inky. That way when away from a windows machine I could easily continue to iterate on the story and keep writing & testing...

This is the last missing functionality that stops me from going fully writing stories on tablet/phone when in train, or just away from the main PC...

To Reproduce

Expected behavior

It would be fantastic compiler didn't dump js scripts content on error & provided more precise error messages like Inky (for the broken .ink file mentioned further down):

Line 2: Failed to load: './IdontExist.ink'

Ink files

// including a non-existing .ink subfile
INCLUDE ./IdontExist.ink

//Start the story
->start_story

=== start_story ===
this is a test story with an error
+ [Finish the test]
    ->END

Environment

smwhr commented 2 months ago

This is a very legitimate demand !

smwhr commented 3 days ago

Sorry for getting back to work on it so late, I just merged something, release coming soon !