y-lohse / inkjs

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

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

Open Pyblo opened 3 weeks ago

Pyblo commented 3 weeks 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 3 weeks ago

This is a very legitimate demand !