Skip to content

fix: Fish env setup using string literal command when using vp env commands#1518

Open
mikkurogue wants to merge 4 commits intovoidzero-dev:mainfrom
mikkurogue:fish-setup
Open

fix: Fish env setup using string literal command when using vp env commands#1518
mikkurogue wants to merge 4 commits intovoidzero-dev:mainfrom
mikkurogue:fish-setup

Conversation

@mikkurogue
Copy link
Copy Markdown

@mikkurogue mikkurogue commented May 5, 2026

I noticed this was an issue with my setup, I'm not sure if it's a problem elsewhere but I noticed that when I ran vp env use 25 it would fail with "command": no such file or directory". Traced it to the env.fish module and changed it to __VP_BIN__ and resourced my config and it was working again.

Thought I'll provide a PR but feel free to flame and tell me I'm totally wrong.

… prevent fish from breaking with `command` no such file or directory when using something like `vp env use 20`l
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 75a2946
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69fb18c8698a120008e9ea0f

@fengmk2 fengmk2 requested a review from nekomoyi May 6, 2026 01:28
@nekomoyi
Copy link
Copy Markdown
Collaborator

nekomoyi commented May 6, 2026

@mikkurogue Thanks for the PR! The change looks reasonable, but I'd like to understand the root cause better before merging.

The vp function is defined inside env.fish, which already prepends __VP_BIN__ to PATH before the function exists. So by the time command vp runs, it should resolve correctly via PATH lookup.

I can't reproduce locally with fish. Could you share more details on how this error occurs — specific fish version, install method, or a repro path?

Also, test cases that assert command usage would need to be updated.

@mikkurogue
Copy link
Copy Markdown
Author

mikkurogue commented May 6, 2026

I'll try my best to explain what I did @nekomoyi

I upgraded vite plus with vp upgrade from 0.1.18 to latest (0.1.20 at time of writing) and noticed when I wanted to change my system node version to use node 26 to play around with the temporal api on a work project that vp env use 26 would result in the failure. Using vp env install 26 did however work just fine. After snooping around my vite-plus install for the env.fish, I saw the command part and found it odd that the error was "command": no such file or directory and that I concluded then it maybe is one of 2 things:

  • Skill issue from me not re-sourcing fish config when upgrading vite plus
  • command is being seen as a string literal to look for a file or directory and tries to execute this instead

In my dotfiles repo I have my fish config which sources the vp env here. I don't think it's wrong but I am not one known to maintain my own configs very well.

Currently on my work laptop so I can't source the full fish but I know it is version 4.6.0. As I have not yet done a system upgrade on my own machine this week.

My system is;
Cachyos kernel 7.0.0-2
Niri latest
Ghostty + Fish

I'm not really too sure how to reproduce this, but I do know if I revert the local changes to the vp env.fish to use command again that it will break again. Note; I havent run vp env setup since installing vite plus on the initial release so I wont rule it out that I'm kind of stupid. I am fully open to the idea that it's just a me issue, and not a vite plus issue.

I'll update the tests later today/tonight (+- 8pm EEST) to at least clean it up. I'll try to provide more information today as the day goes and I'm finished with my day job.
Updated tests to reflect it.

Comment thread pnpm-workspace.yaml
@nekomoyi
Copy link
Copy Markdown
Collaborator

nekomoyi commented May 6, 2026

@mikkurogue I may have found the cause. Could you help me test a change?

set -l __vp_out (env FISH_VERSION=$FISH_VERSION command vp $argv); or return $status

Because it runs through env, command is no longer interpreted as the fish builtin. Instead, env tries to execute an external binary named command.

That explains why I couldn’t reproduce it locally: on my machine, command resolves to /usr/bin/command, but CachyOS may not work as such.

Could you try changing only this line to __VP_BIN__/vp? If this works on your machine, we can keep the rest of the command vp usage unchanged.

@mikkurogue
Copy link
Copy Markdown
Author

Yep, I'll test it later for you when I am at my personal machine. Will update once checked

@mikkurogue
Copy link
Copy Markdown
Author

mikkurogue commented May 6, 2026

Updating fish.env to use
set -l __vp_out (env FISH_VERSION=$FISH_VERSION command vp $argv); or return $status results in the same error:

mikku@cachyos  ><> ~/.vite-plus
> vp env use 25
env: ‘command’: No such file or directory

setting it to set -l __vp_out (env FISH_VERSION=$FISH_VERSION $HOME/.vite-plus/bin/vp $argv); or return $status works as intended, and generating it with __VP_BIN__/vp seems to do the trick.

So I would assume only changing the one instance to __VP_BIN__/vp is sufficient instead of all instances. I'll push the commit as well, to see if we're on the same page 😄

@nekomoyi
Copy link
Copy Markdown
Collaborator

nekomoyi commented May 6, 2026

@mikkurogue That aligns perfectly with what I was expecting. Thanks for the fix!

@mikkurogue
Copy link
Copy Markdown
Author

Can also confirm that on MacOS using fish, the issue does not occur. It must be either a Linux or Cachy problem. I would test on other distros but I don't have the time to find a disk and install all major distros for this and setup fish.

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

Successfully merging this pull request may close these issues.

2 participants