Skip to content

bug: Error executing lua callback #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
arty-hlr opened this issue Apr 1, 2025 · 2 comments
Closed
2 tasks done

bug: Error executing lua callback #386

arty-hlr opened this issue Apr 1, 2025 · 2 comments
Labels
not a bug Not a bug in this plugin

Comments

@arty-hlr
Copy link

arty-hlr commented Apr 1, 2025

Neovim version (nvim -v)

0.11.0-dev

Neovim distribution

N/A

Operating system

Ubuntu

Terminal emulator / GUI

tmux

Describe the bug

Hi, I just wanted to install icons as they were missing, and got this after installing:
Image

Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*": Vim(append):Error executing lua callback: ...le/render-markdown.nvim/lua/render-markdown/integ/ts.lua:77: attempt to call method 'disable_pattern' (a nil value)
stack traceback:
        ...le/render-markdown.nvim/lua/render-markdown/integ/ts.lua:77: in function 'disable'
        ...le/render-markdown.nvim/lua/render-markdown/integ/ts.lua:19: in function 'setup'
        ...dle/render-markdown.nvim/lua/render-markdown/manager.lua:90: in function 'attach'
        ...dle/render-markdown.nvim/lua/render-markdown/manager.lua:25: in function <...dle/render-markdown.nvim/lua/render-markdown/manager.lua:24>
        [C]: in function 'nvim_cmd'
        /usr/share/nvim/runtime/filetype.lua:36: in function </usr/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'pcall'
        vim/shared.lua: in function <vim/shared.lua:0>
        [C]: in function '_with'
        /usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function '_with'
        /usr/share/nvim/runtime/filetype.lua:35: in function </usr/share/nvim/runtime/filetype.lua:10>
Press ENTER or type command to continue

Any idea what might be going wrong?

Expected behavior

Normal rendering of markdown text with icons.

Healthcheck output

![Image](https://github.com/user-attachments/assets/bb81d5d4-5abf-4750-969f-cf1d0a59420b)


render-markdown:                     require("render-markdown.health").check()
  4
  5 render-markdown.nvim [version]
  6 - OK plugin 8.2.1
  7 - OK neovim >= 0.11
  8
  9 render-markdown.nvim [configuration]
 10 - OK valid
 11
 12 render-markdown.nvim [treesitter]
 13 - OK markdown: parser installed
 14 - OK markdown_inline: parser installed
 15 - WARNING latex: parser not installed
 16   - ADVICE:
 17     - Disable latex support to avoid this warning
 18     - require('render-markdown').setup({ latex = { enabled = false } })
 19 - WARNING html: parser not installed
 20   - ADVICE:
 21     - Disable html support to avoid this warning
 22     - require('render-markdown').setup({ html = { enabled = false } })
 23 - OK markdown: highlight enabled
 24
 25 render-markdown.nvim [icons]
 26 - OK using: mini.icons
 27
 28 render-markdown.nvim [executables]
 29 - WARNING latex2text: not installed
 30   - ADVICE:
 31     - Disable latex support to avoid this warning
 32     - require('render-markdown').setup({ latex = { enabled = false } })
 33
 34 render-markdown.nvim [conflicts]
 35 - OK headlines: not installed
 36 - OK markview: not installed
 37 - OK obsidian: not installed

Plugin configuration

Default Configuration

Plugin error log

N/A

Confirmations

  • I have updated this plugin to the latest version using my plugin manager
  • I have provided the text contained in all screenshots as raw text in this issue. This means if there is a screenshot below it is the copy pasted contents of the file in the screenshot. I understand that my issue will be closed if I have not.

Additional information

No response

@arty-hlr arty-hlr added the bug Something isn't working label Apr 1, 2025
@jemag
Copy link

jemag commented Apr 1, 2025

I can also confirm that I am getting this error. Although it seems quite intermittent and not yet sure of the best way to reproduce it 100% in my case.

@MeanderingProgrammer
Copy link
Owner

The error should occur 100% of the time after you open a markdown file for the first time.

The error you're running into happens because you're using 0.11.0 but some dev build before the disable_pattern API was added. This API is part of the release version of 0.11.0.

Calling the API is gated behind a version check but cannot account for every possible point in time a user's build comes from, so I assume it's from the release.

Update your local build or switch to using release builds.

@MeanderingProgrammer MeanderingProgrammer added not a bug Not a bug in this plugin and removed bug Something isn't working labels Apr 1, 2025
@MeanderingProgrammer MeanderingProgrammer marked this as a duplicate of #388 Apr 2, 2025
MeanderingProgrammer added a commit that referenced this issue Apr 2, 2025
## Details

Related issues:

- #386
- #388

The current approach of assuming that most people with dev builds would
update on new releases does not hold true enough.

Take a similar approach as the pcall around `nvim_buf_set_extmark` and
notify users that they should update with a more targeted error message
rather than bubbling up a stack trace when things fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug Not a bug in this plugin
Projects
None yet
Development

No branches or pull requests

3 participants