You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using pcall to safely load a Lua module via require, the call unexpectedly returns true and a non-nil result (often true), even if the module does not exist in the filesystem. This behavior leads to false positives, making it appear as though the module was loaded successfully.
This issue seems to occur because pcall is returning true for the protected call, even when require fails to find the module. As a result, pcall is unable to reliably distinguish between a successfully loaded module and a missing or unavailable module, leading to subtle bugs when relying on pcall(require, ...) as a check for module existence.
To Reproduce
Steps to reproduce the behavior:
type pcall(require("non-existing-package")) in the neovim command line you will get a response like ''true, true"
Since 'strive' is not installed, the error ends up occurring.
Screencast.from.30-04-25.12.18.18.PM.IST.webm
Screenshots
line number 136 is where the error happens
Description
When using pcall to safely load a Lua module via require, the call unexpectedly returns true and a non-nil result (often true), even if the module does not exist in the filesystem. This behavior leads to false positives, making it appear as though the module was loaded successfully.
This issue seems to occur because pcall is returning true for the protected call, even when require fails to find the module. As a result, pcall is unable to reliably distinguish between a successfully loaded module and a missing or unavailable module, leading to subtle bugs when relying on pcall(require, ...) as a check for module existence.
To Reproduce
Steps to reproduce the behavior:
Screencast.from.30-04-25.12.18.18.PM.IST.webm
Screenshots

line number 136 is where the error happens