vim-node
vim-node copied to clipboard
"E121: Undefined variable: b:node_root" error
First of all, thanks for sharing this nice plugin!
When issuing Ctrl+p/n or [+I on some files (which ends with .js) I get the following error:
E121: Undefined variable: b:node_root
Error detected while processing function node#lib#find[8]..<SNR>233_absolutize:
line 7:
E15: Invalid expression: b:node_root . "/node_modules/" . a:name
The variable b:node_root
is indeed undefined on the files which display errors. On the files where the problem doesn't ocurr the variable is defined.
Thanks for taking the time to let me know and sorry for the belated response. I should really look into this! :)
Glad you liked. The code simplification in the PR solved the problem for me, but I may have missed some corner case.
I think I'm having this error too. It's been bugging me for a while and I just today typed the right thing in to google to lead me here.
@johnelliott I've created a pull request with a possible fix. If you'd like to test it, you can clone my E121 branch: https://github.com/mMontu/vim-node/tree/E121
Thanks @mMontu, I read the diff a few days ago. I'll give it a shot. Currently I'm seeing if I was even using the plugin at all. For background, I've been removing plugins in general, nothing against this one 😇
Hi, is there any news on this? This problem appears for me when trying to tab complete. I can post more information if needs be.
This happens for me whenever I tab autocomplete a file with a shebang of #!/usr/bin/node
which doesn't live in a dir with a node_modules
sub folder.
The fix is to create a node_modules
folder, but a patch would be nice.