nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.08k stars 202 forks source link

Failed to load parser for norg #1473

Open avonmoll opened 1 week ago

avonmoll commented 1 week ago

Prerequisites

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

jan-xyz commented 5 days ago

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 commented 5 days ago

@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 commented 5 days ago

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 commented 5 days ago

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 commented 5 days ago

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 commented 4 days ago

@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 commented 4 days ago

@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 commented 3 days ago

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 commented 3 days ago

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

But Lua v5.3.6 works for me

max397574 commented 3 days ago

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