Open MilanDeruelle opened 2 years ago
Hi @MilanDeruelle, that's really strange cause it is working correctly for me. Can you try typing `yarn[space], then removing the space and adding it again? Does it suggest scripts?
No... it suggests a bunch of yarn related commands (e.g. init, add, etc) but no scripts from the package.json
@MilanDeruelle Are you sure you're in the correct directory? Fig seems to think you are in ~/Desktop
which presumably doesn't have it's own package.json
.
Can you share a screen recording of yourself navigating to this directory and typing "yarn [space]"
Yes, I've tried a bunch of different directories with different package.json's (all working fine with just yarn/npm). The screenshots show desktop because I didn't want to leak the project names, since they are from work.
Give me second
@mschrage
https://user-images.githubusercontent.com/9109923/186755704-f71458c8-778b-4b7f-9f96-57ff01331e0b.mov
The package.json looks like this and works fine.
{
"name": "nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "rm -rf .next && next dev",
"build": "NODE_ENV=production next build",
"start": "next start",
"lint": "next lint --quiet"
},
"dependencies": {
"@splidejs/react-splide": "^0.7.8",
"@splidejs/splide": "^4.0.7",
"@svgr/webpack": "^6.2.1",
"case-anything": "^2.1.10",
"favicons": "^6.2.2",
"fs-extra": "^10.1.0",
"graphql": "^16.5.0",
"graphql-request": "^4.3.0",
"next": "12.1.6",
"next-build-cache": "^1.0.4",
"object.hasown": "^1.1.1",
"prop-types": "^15.8.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"ui": "workspace:^",
"use-resize-observer": "^9.0.2",
"uuid": "^8.3.2"
},
"devDependencies": {
"eslint": "8.17.0",
"eslint-config-next": "12.1.6"
}
}
Can you share a screenshot of the Fig debugger in the menubar icon? I want to see what we think the current working directory is?
Also is there another package.json
file higher up in the folder structure?
Btw do you have npm
installed? Could you try running npm prefix
in that directory?
It looks like the yarn
completion spec is using this generator under the hood: https://github.com/withfig/autocomplete/blob/4804172f7e9241d362c946c92cb1d7c24c3c1639/src/npm.ts#L159
You might try running until [[ -f package.json ]] || [[ $PWD = '/' ]]; do cd ..; done; cat package.json
as well and see what the output is?
PS. sorry for spamming comments.
@mschrage
I've tried with both "complex" package.json files that are split across the folder structure and "simple" ones that exist just on their own. Same result in both cases. Also, in both cases the scripts are found in the package.json that is in the CWD.
npm prefix:
I was just looking at the code and tried some of the scripts fig uses to get the package.json and all I found (including the one you posted) returned the correct output.
This issue has been automatically closed because there has been no activity for 14 days.
This issue has been automatically closed because there has been no activity for 14 days.
Hi @mschrage and @MilanDeruelle , has this issue been resolved? I've been facing a similar problem since morning, as everything was working fine until yesterday.
Same here as @Abhishek765Flyfin
Hi @mschrage and @MilanDeruelle , has this issue been resolved? I've been facing a similar problem since morning, as everything was working fine until yesterday.
hey there not sure how but this is working again 👍 , thanks a lot
Sanity checks
fig doctor
in the affected terminal sessionfig restart
and tested again (tell us if that fixed it)Issue Details
When I'm in a folder with a package.json, the autocomplete window opens and displays suggestions, however none of them are from the package.json script section. Doesn't work across different folders/package.json files.
Might this be related to the oh-my-zsh plugins I have installed?
When inspecting the autocomplete window, there seem to be no specific errors.
Environment