Always getting the error, TypeError: r is null, even when copying code directly from the Documentation

I am trying to follow the examples found here: https://docs.narrat.dev/scripting/language-syntax.htm

But in every example where I try to call a variable I get an error TypeError: r is null

For example when I use this code:

main:
  set data.player.name "Alice"
  set data.player.age 25
  "The player's name is %{data.player.name} and they are %{data.player.age} years old"

Gives me this error:
Narrat script runtime error at game.narrat:4
TypeError: r is null
Script : “The player’s name is %{data.player.name} and they are %{data.player.age} years old”
Label: main

Copying this code

main:
  set data.player.inventory (new Array "Sword" "Shield" "Potion")
  var array_contents (array_join $data.player.inventory)
  "Your inventory contains  %{array_contents}"

Gives me the same error as above except this line:
Script: “Your inventory contains %{array_contents}”

  • :browser: : Which browser? :firefox:

Use %{$data.player.name}, variables need a $ when you refer to their values. Docs might be outdated

Also looking at the default game script that’s in the engine (and linked in a few places in the docs I think) can be a good way to find working examples of syntax since it’s used for testing and has a bit of everything