nuxtrdev / nuxtr-vscode

An extension offering commands and tools to make your experience with Nuxt more pleasant.
https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode
327 stars 13 forks source link

[Bug]: Commands do not work in Windows #105

Closed RaphaelDDL closed 8 months ago

RaphaelDDL commented 8 months ago

Environment

Windows10 Pro 22H2

What went wrong?

image

How to reproduce it?

On Windows:

Get error above. Couldn't find any issue opened regarding Win, nor this error. Restarting VSCode didn't make any difference.

HybridEyeGrillage commented 8 months ago

I had the same issue as you did, @RaphaelDDL. Did you modify any of the Nuxtr settings in VSCode? I had quite a few and it seems that by resetting all of then, I managed to be able to do the commands again.

I hadn't done a full investigation into which or what combination of the settings is causing the issue, but maybe someone else can look into it.

adhamfarrag commented 8 months ago

Hi @RaphaelDDL @HybridEyeGrillage, This bug is caused by activation issues, unrelated to your usage/settings.

Nuxtr activates only when you have a Nuxt project. If you create a new project when Nuxtr is activated (let's say Nuxt icon in the sidebar is visible), it should work properly. Also, if you notice Nuxtr: create new project is the only command you can see when Nuxtr is deactivated, on purpose to be able to create a new project without this issue.

Apologies for the unfinished work here, have to refactor couple things to be able to make it work without this bug and working on it.

HybridEyeGrillage commented 8 months ago

That seems strange still. Yes, I activated Nuxtr on an existing Nuxt project, but after running a few commands, I modified my VSCode settings. After that, I couldn't get to any other commands than Nuxtr: Create error.vue layout and Nuxtr: Create new Project. Resetting the changed rules made it work again as before.

But thanks for confirming it's a known issue.

adhamfarrag commented 8 months ago

@HybridEyeGrillage Can you help me reproduce this? What settings did you change ?

RaphaelDDL commented 8 months ago

In my case, I installed the plugin and tried to create a new Nuxt project, that is all. Seeing it wasn't working, then I went on options and picked NPM just to make sure.

I assumed that create project would start a new project on an empty folder (kinda like a helping hand for nuxi command) as readme says "Using Nuxtr: Create Nuxt project command, you can create a new Nuxt project with a few steps". Am I mistaken? You said "Nuxtr activates only when you have a Nuxt project."... so I need a existing project to create a project? o_O

HybridEyeGrillage commented 8 months ago

@HybridEyeGrillage Can you help me reproduce this? What settings did you change ? @adhamfarrag Let's see...

* Default Package Manager: pnpm
* Open files after creation [x]
* Pinia Files: 
* Default Template: setup
* Vue Files: 
* First Tag: script
* Always Scoped [X]
* Default Language: scss
* Editor:
* Default Folding Range Provider: Volar 

After doing this, I reloaded the window and then tried to get the Nuxtr commands; I only saw the two options that I mentioned before again. I also didn't import any other custom settings (no .vscode folder or setings.json file), so it's the default VSCode settings. Not sure using WSL: Ubuntu also plays into this... I hope that this doesn't detracts from OP's initial post, but the error is the same.

I assumed that create project would start a new project on an empty folder (kinda like a helping hand for nuxi command) as readme says "Using Nuxtr: Create Nuxt project command, you can create a new Nuxt project with a few steps". Am I mistaken? You said "Nuxtr activates only when you have a Nuxt project."... so I need a existing project to create a project? o_O

I also find this a bit contradictory- most would assume @RaphaelDDL's understanding as well. Or is this command geared more towards a monorepo setup in Nuxt?

adhamfarrag commented 8 months ago

@HybridEyeGrillage, Currenly Nuxtr only supports having one FE layer in your monorepo, and you should configure it manually using "nuxtr.monorepoMode.DirectoryName": "directory-name".

Now I believe that @RaphaelDDL's issue is different from yours. Can you open a new issue if my suggestion didn't work for you ?

adhamfarrag commented 8 months ago

@RaphaelDDL Nuxtr 0.2.13 should include fixes for your bug. Please, update.

RaphaelDDL commented 8 months ago

Updated, same error. So I uninstalled, reloaded, reinstalled, reloaded, v0.2.13 active, same error.

So I played around a bit more and I found out the difference between work vs doesn't work:

So yeah, basically the command does not work if you only have a VSCode window open, clean, no folder. Whenever opening any folder whatsoever, then it works in all steps. Opening only a File does not work either.

Not sure if is a VSCode issue/permission or not that command doesn't work without open folder, even if you are not going to use it.