vi studio

Lessons · Building apps · 26 of 36

Errors and good habits

The real error messages and their fixes; how to organise a project.

Vi checks the code as you type. Problems show as red (errors: the app can't run) or yellow (warnings: it runs, but something is off) underlines and in the Problems tab. Most have a Fix button there, or a light bulb in the editor.

You see It means The fix
Unknown container 'heder' a misspelt or missing name pick the suggested name, or Create container 'heder'
Unknown function 'ad_task' the function doesn't exist pick the suggested name, or Create function 'ad_task()'
Unknown attribute 'colour' not an attribute Vi knows Change to 'color'
Nothing to run: mark the screen with 'main'… no main container Add main container, or Mark … as the main container
Your own files need no import… an import of a file of the project Remove this import line
'header' is also defined in src/a.vi the same name in two files rename one of them
'name_box' is defined inside 'form' and is not visible here an inside name used from outside Use 'form.name_box'

Good habits:

Every example here runs in Vi Studio: open it in your browser (phones too) and press Start learning on the welcome page. Each code block there has a Try it button that runs it in the phone preview.

More in Building apps

About Vi. Vi is a free, open-source programming language for building real mobile apps. You describe each screen in plain words, and Vi compiles it to React Native (Expo) for Android, iOS and the web. Its editor, Vi Studio, runs on Windows, in any browser and on your phone, with the app running live as you type. Read more about Vi.