Skip to content
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

Failed to load parser for norg #1473

Open
2 tasks done
avonmoll opened this issue Jun 20, 2024 · 10 comments
Open
2 tasks done

Failed to load parser for norg #1473

avonmoll opened this issue Jun 20, 2024 · 10 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@avonmoll
Copy link

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info

Neorg setup

        require('neorg').setup {
            load = {
                ["core.defaults"] = {
                    config = {
                        disable = { "core.todo-introspector" }, -- temporary bugfix for https://github.com/nvim-neorg/neorg/issues/1408
                    }
                },                                              -- Loads default behaviour
                ["core.concealer"] = {},                        -- Adds pretty icons to your documents
                ["core.dirman"] = {                             -- Manages Neorg workspaces
                    config = {
                        workspaces = {
                            notes = "~/neorg",
                        },
                        default_workspace = "notes",
                    },
                },
                ["core.completion"] = {
                    config = {
                        engine = "nvim-cmp",
                    },
                },
                ["core.qol.toc"] = {
                    config = {
                        close_after_use = true,
                    },
                },
                ["core.integrations.telescope"] = {},
                ["external.templates"] = {
                    config = {
                        keywords = {
                            TODAY_OF_FILE_ORG = function() -- detect date from filename and return in org date format
                                local ls, m = imports()
                                -- use m.file_name_date() if you use journal.strategy == "flat"
                                return ls.text_node(m.parse_date(0, m.file_tree_date(), [[<%Y-%m-%d %a]])) -- <2006-11-01 Wed>
                            end,
                            TODAY_OF_FILE_NORG = function()                                                -- detect date from filename and return in norg date format
                                local ls, m = imports()
                                -- use m.file_name_date() if you use journal.strategy == "flat"
                                return ls.text_node(m.parse_date(0, m.file_tree_date(), [[%a, %d %b %Y]]))    -- Wed, 1 Nov 2006
                            end,
                            TODAY_ORG = function()                                                            -- detect date from filename and return in org date format
                                local ls, m = imports()
                                return ls.text_node(m.parse_date(0, os.time(), [[<%Y-%m-%d %a %H:%M:%S>]]))   -- <2006-11-01 Wed 19:15>
                            end,
                            TODAY_NORG = function()                                                           -- detect date from filename and return in norg date format
                                local ls, m = imports()
                                return ls.text_node(m.parse_date(0, os.time(), [[%a, %d %b %Y %H:%M:%S]]))    -- Wed, 1 Nov 2006 19:15
                            end,
                            NOW_IN_DATETIME = function()                                                      -- print current date+time of invoke
                                local ls, m = imports()
                                return ls.text_node(m.parse_date(0, os.time(), [[%Y-%m-%d %a %X]]))           -- 2023-11-01 Wed 23:48:10
                            end,
                            YESTERDAY_OF_FILEPATH = function()                                                -- detect date from filename and return its file path to be used in a link
                                local ls, m = imports()
                                return ls.text_node(m.parse_date(-1, m.file_tree_date(), [[../../%Y/%m/%d]])) -- ../../2020/01/01
                            end,
                            TOMORROW_OF_FILEPATH = function()                                                 -- detect date from filename and return its file path to be used in a link
                                local ls, m = imports()
                                return ls.text_node(m.parse_date(1, m.file_tree_date(), [[../../%Y/%m/%d]]))  -- ../../2020/01/01
                            end,
                        }
                    }
                },
            },

Actual behavior

Running :Neorg sync-parsers results in errors when I run :checkhealth nvim-treesitter like the following:

- ERROR norg(highlights): ...arm64/share/nvim/runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'norg': uv_dlopen: no error
  norg(highlights) is concatenated from the following files:
  | [ERROR]:"/Users/.../.local/share/nvim/lazy/neorg/queries/norg/highlights.scm", failed to load: ...arm64/share/nvim/runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'norg': uv_dlopen: no error

Expected behavior

No errors when compiling/installing parsers.

Steps to reproduce

Running on an M3 mac:

:Neorg sync-parsers
:checkhealth nvim-treesitter

Potentially conflicting plugins

No response

Other information

No response

Help

None

Implementation help

No response

@avonmoll avonmoll added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Jun 20, 2024
@jan-xyz
Copy link

jan-xyz commented Jun 26, 2024

For me installing the parser fails with

        `lua5.1` or `lua` version `5.1` not installed
        `lua` version `5.1` needed, but found `Lua 5.4.6  Copyright (C) 1994-2023 Lua.org, PUC-Rio`

        This plugin requires `luarocks`. Try one of the following:
         - fix your `luarocks` installation
         - enable `hererocks` with `opts.rocks.hererocks = true`
         - disable `luarocks` support completely with `opts.rocks.enabled = false`

@TarunDaCoder
Copy link

TarunDaCoder commented Jun 26, 2024

@jan-xyz

For me installing the parser fails with

        `lua5.1` or `lua` version `5.1` not installed
        `lua` version `5.1` needed, but found `Lua 5.4.6  Copyright (C) 1994-2023 Lua.org, PUC-Rio`

        This plugin requires `luarocks`. Try one of the following:
         - fix your `luarocks` installation
         - enable `hererocks` with `opts.rocks.hererocks = true`
         - disable `luarocks` support completely with `opts.rocks.enabled = false`

Do you have luarocks installed?

@jan-xyz
Copy link

jan-xyz commented Jun 26, 2024

Yes, I do, I also checked and it's on the PATH and I can run it from there and the Lazy.nvim health check also can find it.

@TarunDaCoder
Copy link

TarunDaCoder commented Jun 26, 2024

lua version 5.1 needed, but found Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio

Hmm I wonder why it's telling you to downgrade your lua version 🤔

@TarunDaCoder
Copy link

Yes, I do, I also checked and it's on the PATH and I can run it from there and the Lazy.nvim health check also can find it.

Do you have the luarocks.nvim plugin installed aswell?

@avonmoll
Copy link
Author

@jan-xyz - I had a similar issue when trying to install luarocks.nvim. I ended up doing brew install luajit in order to get that installed. I'm not certain whether or not that issue is related to the errors I posted above.

@jan-xyz
Copy link

jan-xyz commented Jun 26, 2024

@jan-xyz - I had a similar issue when trying to install luarocks.nvim. I ended up doing brew install luajit in order to get that installed. I'm not certain whether or not that issue is related to the errors I posted above.

oh sorry, then please disregard my case. I will split it out if I cannot figure it out. I have luajit install and it is still broken :(

Do you have the luarocks.nvim plugin installed aswell?

I am using the latest lazy.nvim version and according to the announcement by folke on Reddit, it's not needed anymore? I will dig a bit and see if there is something wrong and then open a separate issue since this seems to be about some other error.

https://www.reddit.com/r/neovim/comments/1dng1d6/lazynvim_110_is_released_packages_luarocks_and/

EDIT: just found this GitHub issue and it is a problem on lazy.nvim side.

@benlubas
Copy link
Contributor

lua version 5.1 needed, but found Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio

Hmm I wonder why it's telling you to downgrade your lua version 🤔

because they need to "downgrade their lua version"...

Just install lua5.1 and it'll work. Reason being that lua5.1 is the version that's compatible with neovim, so that's what lazy checks for. It's possible for lazy to update and require lua5.1 or luajit, but that's not the case last I checked (like 2 days ago).

@TarunDaCoder
Copy link

Reason being that lua5.1 is the version that's compatible with neovim

But Lua v5.3.6 works for me

@max397574
Copy link
Contributor

But Lua v5.3.6 works for me

well then that's nice for you
but still the official version for neovim is 5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

5 participants