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 run config for sonicpi.nvim #7

Open
Elahi-cs opened this issue Jan 23, 2024 · 2 comments
Open

Failed to run config for sonicpi.nvim #7

Elahi-cs opened this issue Jan 23, 2024 · 2 comments

Comments

@Elahi-cs
Copy link
Contributor

After installing the plugin with lazy.nvim and trying to open a .sonicpi file with nvim I get the following error:

Failed to run `config` for sonicpi.nvim
...a/Local/nvim-data/lazy/sonicpi.nvim/lua/sonicpi/init.lua:109: attempt to index local 'opts' (a nil value)
# stacktrace:
  - sonicpi.nvim\lua\sonicpi\init.lua:109 _in_ **setup**
  - ~/AppData/Local/nvim/lua/packages/sonicpi.lua:8 _in_ **config**
  - ~\AppData\Local\nvim\init.lua:21

This is the sonicpi.lua file referenced in the second line of the stack trace:

return {
    'magicmonty/sonicpi.nvim',
    dependencies = {
        'hrsh7th/nvim-cmp',
        'kyazdani42/nvim-web-devicons'
    },
    config = function()
        require('sonicpi').setup()
    end,
}

I haven't done any LSP or CMP setups in case this might be related.

@vikke
Copy link

vikke commented Feb 13, 2024

I have same problem on linux and windows11.
my lazy.nvim code is below.

require("lazy").setup({
    ....
    ....
	{
		'magicmonty/sonicpi.nvim',
		config = function()
			require('sonicpi').setup()
		end,
		dependencies = {
			'hrsh7th/nvim-cmp',
			'kyazdani42/nvim-web-devicons',
		},
		single_file = true
	},
})

require('sonicpi').setup({
  server_dir = '/var/lib/flatpak/app/net.sonic_pi.SonicPi/current/active/files/app/server',
  mappings = {
    { 'n', '<leader>s', require('sonicpi.remote').stop, default_mapping_opts },
    { 'i', '<M-s>', require('sonicpi.remote').stop, default_mapping_opts },
    { 'n', '<leader>r', require('sonicpi.remote').run_current_buffer, default_mapping_opts },
    { 'i', '<M-r>', require('sonicpi.remote').run_current_buffer, default_mapping_opts },
  },
  single_file = true,
})

@vikke
Copy link

vikke commented Feb 13, 2024

I resolve it.

	{
		'magicmonty/sonicpi.nvim',
--		config = function()
--			require('sonicpi').setup()
--		end,
		dependencies = {
			'hrsh7th/nvim-cmp',
			'kyazdani42/nvim-web-devicons',
		},
		single_file = true
	}

comment out config block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants