question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

E5108: Error executing lua ...es/neovim/.config/nvim/plugged/vim-ultest/lua/ultest.lua:60: attempt to index local 'test' (a userdata value)

See original GitHub issue

Describe the bug

While trying to run a TypeScript (filetype typescript) test with UltestDebugNearest, I run into this:

E5108: Error executing lua ...es/neovim/.config/nvim/plugged/vim-ultest/lua/ultest.lua:60: attempt to index local 'test' (a userdata value)

The vim-ultest.log file contains this:

10:02:19 | INFO | MainThread | logging.py:create_logger:74 | Logger created
10:02:19 | DEBUG | MainThread | __init__.py:__init__:40 | Handler created

Additional context

nvim --version

NVIM v0.5.0-dev+1231-g48e805728
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/nvim/parts/nvim/build/build/config -I/build/nvim/parts/nvim/build/src -I/build/nvim/parts/nvim/build/.deps/usr/include -I/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include
Compiled by root@lgw01-amd64-055

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

python --version

Python 3.8.6

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:25 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
tlindsaycommented, May 18, 2021

@rcarriga Sorry for the noise on this one. Turns out I needed to run :UpdateRemotePlugins, and then everything started working

1reaction
rcarrigacommented, Apr 9, 2021

So there was a number of issues that you raised so I’ll address separately.

  1. The test#filename_modifier variable will now be respected
  2. Tests will now run with g:test#project_root as the current working directory if it exists
  3. I’ve added g:ultest_pre_run which should be a function name, which will be called before any test is run with Ultest, UltestNearest, UltestDebugNearest and the corresponding <Plug> mappings

As I said before, you will have to manually configure nvim-dap to respect the project root.

Also the reason vim-test doesn’t detect your file as a test is because it can’t tell if your runner is installed. Simply explicitly state what your runner is so for example with javascript/typescript and jest

let g:test#javascript_runner = "jest"

Please let me know if anything isn’t working as expected!

Read more comments on GitHub >

github_iconTop Results From Across the Web

C++ LuaBridge attempt to index a userdata value (local 'self')
I'm generating keys for each class and storing those keys in the Lua registry. The key generation uses a static templated method that...
Read more >
Development troubleshooting - Minetest Developer Wiki
... call a method from it, I get a Lua error that says something along the lines of "attempt to index local 'objecthere'...
Read more >
attempt to concatenate local 'message' (a userdata value ...
I've been trying to make a chat and I've been running into this problem where it says "attempt to concatenate local 'message' (a...
Read more >
Attempt to call a userdata value - Scripting Support - DevForum
hello robloxians, i tried to make npc that teleport to brick when player comming to ... You should test your scripts before making...
Read more >
openresty 执行错误,有人能帮我分析下原因吗?
... 15773#0: *16809007 lua entry thread aborted: runtime error: /opt/openresty/lua/test.lua:82: attempt to index local 'res1_body' (a userdata value).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found