# Lua: Difficult identifying syntax errors

**URL:** <https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059>\
**Category:** General\
**Created:** [March 27, 2025, 10:49pm UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059 "2025-03-27T22:49:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lutzky](https://community.silverbullet.md/user_avatar/community.silverbullet.md/lutzky/32/624_2.png) [@lutzky](https://community.silverbullet.md/u/lutzky)\
**Post date:** [March 27, 2025, 10:49pm UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059/1 "2025-03-27T22:49:30Z")

</div>

Suppose I do this:

````lua
```space-lua
config.set {
  smartQuotes = { enabled: false }
}
```

````

…and hit Reload. Nothing happens. Because there’s a subtle bug in the way I imported this from the previous YAML syntax, see if you can spot it. But, more importantly, the message only appears in the JS console.

Worse yet, the message that appears is "Error evaluating script: Parse error in "… followed by the entire block of space-lua. Would it be possible to get a more specific indicator? Am I missing something?

---

<div class="post-metadata">

**Author:** ![nguyeho7](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/n/f1d935/32.png) [@nguyeho7](https://community.silverbullet.md/u/nguyeho7)\
**Post date:** [March 28, 2025, 1:08am UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059/2 "2025-03-28T01:08:58Z")

</div>

I totally agree that the errors are impossible to decipher. I tried using silverbullet as a lite IDE with a button-to-execute to learn lua (I imagined i don’t need to leave the environment at all, which would be super cool) but I suppose it’s not quite there yet.

---

<div class="post-metadata">

**Author:** ![malys](https://community.silverbullet.md/user_avatar/community.silverbullet.md/malys/32/840_2.png) [@malys](https://community.silverbullet.md/u/malys)\
**Post date:** [March 28, 2025, 9:44am UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059/3 "2025-03-28T09:44:49Z")

</div>

I use [Run Lua in the browser - glot.io](https://glot.io/new/lua) to write my code and after copy and paste

`

```embed
url: https://glot.io/new/lua
height: 1000

```

`

---

<div class="post-metadata">

**Author:** ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)\
**Post date:** [March 28, 2025, 11:43am UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059/4 "2025-03-28T11:43:22Z")

</div>

I hear you, I run into the same issue a lot. Let me see if I can improve this a little bit.

---

<div class="post-metadata">

**Author:** ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)\
**Post date:** [March 28, 2025, 11:51am UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059/5 "2025-03-28T11:51:11Z")

</div>

That wasn’t so hard, just pushed this to #v2 :

 ![image](https://community.silverbullet.md/uploads/default/original/2X/2/2a0a522918daa4e88b6210088deda52b0265b7c0.png)

Should be available in a few minutes.

---

<div class="post-metadata">

**Author:** ![lutzky](https://community.silverbullet.md/user_avatar/community.silverbullet.md/lutzky/32/624_2.png) [@lutzky](https://community.silverbullet.md/u/lutzky)\
**Post date:** [March 28, 2025, 12:48pm UTC](https://community.silverbullet.md/t/lua-difficult-identifying-syntax-errors/2059/6 "2025-03-28T12:48:15Z")

</div>

This is great! It’s specific to parse errors though, e.g. this will still fail silently:

````lua
```space-lua
call_nonexistent_function()

-- The following never executes

config.set {
  -- Valid stuff
}
```

````

The log will show “Attempting to call nil as a function at [[actually\_really\_specific\_ref@123]]” - can we perhaps render that to the document so it’s clickable?
