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

BUG: [Neo-tree ERROR] Error setting nodes: .../.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:36: duplicate node id/Users/<project_path>/.flake8 #1578

Open
3 tasks done
sankarraj-ps opened this issue Oct 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sankarraj-ps
Copy link

sankarraj-ps commented Oct 7, 2024

Did you check docs and existing issues?

  • I have read all the docs.
  • I have searched the existing issues.
  • I have searched the existing discussions.

Neovim Version (nvim -v)

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382

Operating System / Version

MacOS 14.7 (23H124)

Describe the Bug

When try to open the neo-tree sidebar getting this error and I cannot load the neo-tree buffer.

It says [Neo-tree ERROR] Error setting nodes: .../.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:36: duplicate node id/Users/<project_path>/.flake8

Mostly it has issues with .flake8 file.

Steps to Reproduce

  1. Just open neovim and try to open the neo-tree buffer

Expected Behavior

  1. Should show my files

Your Configuration

{
  "nvim-neo-tree/neo-tree.nvim",
  branch = "v3.x",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "nvim-tree/nvim-web-devicons",
    "MunifTanjim/nui.nvim",
    'saifulapm/neotree-file-nesting-config', -- add plugin as dependency. no need any other config or setup call
  },
  opts = {
    -- recommanded config for better UI
    hide_root_node = true,
    retain_hidden_root_indent = true,
    filesystem = {
      filtered_items = {
        show_hidden_count = false,
        never_show = {
          '.DS_Store',
        },
      },
    },
    default_component_configs = {
      indent = {
        with_expanders = true,
        expander_collapsed = '',
        expander_expanded = '',
      },
    },
    mappings = {
      ["P"] = { "toggle_preview", config = { use_float = false, use_image_nvim = true } },
      ["l"] = "focus_preview",
      ["<C-b>"] = { "scroll_preview", config = { direction = 10 } },
      ["<C-f>"] = { "scroll_preview", config = { direction = -10 } },
    },
    update_focused_file = {
      enable = true,
      update_cwd = true,
    },
    view = {
      width = 30,
      side = "left",
      auto_resize = false,
    },

  },
  config = function(_, opts)
    opts.nesting_rules = require('neotree-file-nesting-config').nesting_rules

    vim.keymap.set("n", "<tab>", ":Neotree filesystem reveal left<CR>", {})
    vim.keymap.set("n", "<C-b>", ":Neotree focus buffers left<CR>", {})
    vim.keymap.set("n", "<C-g>", ":Neotree focus git_status left<CR>", {})

    require("neo-tree").setup(opts)
  end
}
@sankarraj-ps sankarraj-ps added the bug Something isn't working label Oct 7, 2024
@jeffglover
Copy link

jeffglover commented Nov 2, 2024

I'm getting a similar error with .python-version.

[Neo-tree ERROR] Error setting nodes: ...er/.local/share/nvim/lazy/nui.nvim/lua/nui/tree/init.lua:36: duplicate node id/home/<user>/<project_path>/.python-version

Neovim Version (nvim -v)

NVIM v0.10.2
Build type: RelWithDebInfo
LuaJIT 2.1.1727870382

Operating System / Version

Arch Linux

EDIT

Adding it to filesystem.filtered_items.never_show works. I'm ok with that, as there is rarely a reason to edit it by hand anyway.

filesystem = {
  filtered_items = {
    visible = true,
    never_show = { '.git', '__pycache__', '.python-version' },
  },
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants