Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier- TypeError: Cannot read properties of undefined (reading 'uid') #3020

Closed
sumanssaurabh opened this issue Jun 9, 2023 · 79 comments · Fixed by #3030
Closed

Prettier- TypeError: Cannot read properties of undefined (reading 'uid') #3020

sumanssaurabh opened this issue Jun 9, 2023 · 79 comments · Fixed by #3030
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@sumanssaurabh
Copy link

sumanssaurabh commented Jun 9, 2023

Edited by maintainer

I'll work on this. So please do not post any more +1 comments..

#3020 (comment)


Type: Bug

Prettier running in ssh remote gives error
vscode TypeError: Cannot read properties of undefined (reading 'uid') at Object.statSync (/home/ubuntu/.vscode-server/bin/b380da4ef1ee00e224a15c1d4d9793e27c2b6302/node_modules/graceful-fs/polyfills.js:313:17)

Extension version: 9.13.0
VS Code version: Code 1.79.0 (b380da4ef1ee00e224a15c1d4d9793e27c2b6302, 2023-06-07T14:26:35.552Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Connection to 'ssh-remote+neo' could not be established

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz (4 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.89GB (8.05GB free)
Process Argv
Screen Reader no
VM 0%

Connection to 'ssh-remote+neo' could not be established

@aleimu
Copy link

aleimu commented Jun 9, 2023

+1

@mupkoo
Copy link

mupkoo commented Jun 9, 2023

This happened to me this morning after I upgraded VS Code to 1.79.0

@Clark-G
Copy link

Clark-G commented Jun 9, 2023

This also happended to me today, my vs code version is 1.79.0

@einarpersson
Copy link

Same here 1.79.0

@NattakornS
Copy link

Me also happened on vscode 1.79.0.

@xiaojia21190
Copy link

+1

@sumanssaurabh
Copy link
Author

workaround suggested in #3019 (comment)

Quick fix, add to project settings in .vscode/settings.json

"prettier.prettierPath": "./node_modules/prettier"

@gyhyfj
Copy link

gyhyfj commented Jun 9, 2023

same problem

@szszoke
Copy link

szszoke commented Jun 9, 2023

The problem started for me after I went from 1.78.2 to 1.79.0.

@paul-vd
Copy link

paul-vd commented Jun 9, 2023

Same here

@adsonmacedo
Copy link

+1

@AnmSaiful
Copy link

I just attempted to report the issue and found this one.

+1

@souvikmishra
Copy link

+1 also happens when running vscode in wsl

@ghost
Copy link

ghost commented Jun 9, 2023

+1

And my vs code version is 1.79.0

@Rigel-Developer
Copy link

same problem here!!

@gitawego
Copy link

gitawego commented Jun 9, 2023

I've the same issue with vscode 1.79.0

@trulycool
Copy link

Same problem directly after upgrade VS Code. The fix suggested above by @sumanssaurabh fixed it straight away, no reload/restart required...thanks very much for that!
🙏

@narcis-fv
Copy link

+1

@MikeFranco
Copy link

Solved with @sumanssaurabh fix, thanks man ❤️

@jngchenghin-msft
Copy link

jngchenghin-msft commented Jun 9, 2023

+1 that it started happening when I upgraded my VSCode, but @sumanssaurabh 's fix worked perfectly for me too.

@kayandra
Copy link

kayandra commented Jun 9, 2023

+1 here.... I was going crazy thinking I'd somehow broken my vscode installation.

@JoarDev
Copy link

JoarDev commented Jun 9, 2023

+1 first time trying the prettier extension and this happened :(

@oezguerisbert
Copy link

Here is a small quickfix.
Create a file in the root of the project; .vscode/settings.json

{
  ...
  "prettier.prettierPath": "./node_modules/prettier"
}

@victor-pagnozi
Copy link

workaround suggested in #3019 (comment)

Quick fix, add to project settings in .vscode/settings.json

"prettier.prettierPath": "./node_modules/prettier"

Solved with your fix, man!! Tksss

@709kyb
Copy link

709kyb commented Jun 10, 2023

@sumanssaurabh it works ! thanks man.

@dantevicenzo
Copy link

workaround suggested in #3019 (comment)

Quick fix, add to project settings in .vscode/settings.json

"prettier.prettierPath": "./node_modules/prettier"

This solved here. Thanks!

@jeremydthomas
Copy link

workaround suggested in #3019 (comment)

Quick fix, add to project settings in .vscode/settings.json

"prettier.prettierPath": "./node_modules/prettier"

thank you so much, fixed it!

@immois
Copy link

immois commented Jun 11, 2023

It also works by adding it to the VSCode configuration like this:

Looking for Prettier Path and adding ./node_modules/prettier
image

@jtapeg
Copy link

jtapeg commented Jun 11, 2023

The correction must be made by vscode, the problem is in the extension installation

This solution doesn't work well if the file is not together with node_modules
image

kevinyou added a commit to kevinyou/blog that referenced this issue Jun 11, 2023
@jtorresv232
Copy link

Why is this closed, what is the fix?

@apmoronez
Copy link

Why is this closed, what is the fix?

it literally says "fixed by #3030 "

@Apestein
Copy link

RIP to the people who didn't find this and still trying to debug right now 💀

julianochoi pushed a commit to iaurg/42-transcendence that referenced this issue Jun 17, 2023
* fix: prettier bug in recent version prettier/prettier-vscode/issues/3020

* fix: env logic inside project
iaurg added a commit to iaurg/42-transcendence that referenced this issue Jun 20, 2023
* feat: configure tailwindcss

* refactor: remove not used images

* feat: add layout images to assets

* feat: update nextjs to latest

* refactor: remove not used files

* style: change global style based on layout

* feat: create default global layout

* feat: public not found page

* feat: home page

* feat: login page

* feat: auth 2fa page

* feat: default global layout for game private screen

* feat: pattern pages game

* feat: chat component

* feat: sidebar component

* feat: add avatar

* feat: create user status component

* feat: create header

* feat: start leaderboard

* feat: create user info component

* feat: create leaderboard components

* feat: add scrollbar tailwind package

* feat: create channel card

* feat: create friend card

* feat: add is friend validator

* fix: links to use next link

* feat: create list channels component

* feat: create list friends component

* feat: add change components lists logic

* feat: create channel component

* feat: global style to fix screen

* feat: start open channel component

* feat: start adding game canvas

* fix: remove random icon to avoid hydratation error

* feat: create start canvas with moving ball

* feat: add paddle moves

* feat: add request api libs

* docs: env example

* feat: add api logic with axios

* feat: add react query with examples querying

* game events initial structure implemented

* first ball physics prototype

* simple gateway socket connection

* feat: add config to allow websocket nextjs

* fix: prettier bug in recent version prettier/prettier-vscode/issues/3020

* fix: env logic inside project

* feat: moving ball from websocket working

* feat: create profile public popover

* style: game based on layout

* feat: add react hook form into channel creation

* feat: create chat context

* style: add cursor pointer into close action

* feat: use context and adjust resizes

* feat: create chat bubbles inside opened channel

* feat: add user actions into open channel

* feat: remove not used test function

---------

Co-authored-by: Guilherme Martinelli <[email protected]>
@Ev357
Copy link

Ev357 commented Jun 21, 2023

RIP to the people who didn't find this and still trying to debug right now 💀

I had this error, on a code that actually used a variable named uid, so i was super confused XD

@Hibrix-net
Copy link

Hello,

I am currently experiencing an issue with the Prettier module. It appears to have stopped functioning correctly for me starting from version 9.12.0. The plugin is now prompting me to npm install the module either locally or globally.

As a temporary workaround, I have downgraded to version 9.10.4, which has allowed me to continue using the module as usual. However, this is not a long-term solution.

I have attempted to follow the solution suggested by @sumanssaurabh, but unfortunately, it did not resolve the issue for me.

Could anyone provide some insight or assistance on this matter? Any help would be greatly appreciated.

Thank you.

@Soviut
Copy link

Soviut commented Jun 23, 2023

@Hibrix-net sorry to hear you're having a problem but please don't use closed issues to report new issues. Please report a new issue.

@Hibrix-net
Copy link

Hello @Soviut,

Thank you for your response. I apologize for any confusion, but I was under the impression that this issue was still open as it doesn't explicitly state that it's closed. Could you kindly clarify why this issue is considered closed? Also, could you please point me to the solution that resolved the original issue? This information will help me understand if my problem is indeed different and warrants a new issue.

Thank you for your assistance.

@farzadso
Copy link

@Hibrix-net It was closed because the issue was solved in a recent update and the proposed workaround is no longer required.

@Hibrix-net
Copy link

@Hibrix-net It was closed because the issue was solved in a recent update and the proposed workaround is no longer required.

The latest version is v9.16.0, right? but I'm still encountering the issue. I'm curious, am I the only one still experiencing this problem?

@farzadso
Copy link

@Hibrix-net

I think it's best to do the follow-up in a separate issue as your issue seems a bit different (asking you to do some sort of npm install). And yes the latest version is v9.16.0.

I also recommend adding logs/screenshots to your issue.

@Hibrix-net
Copy link

Hello @Soviut,

Thank you for your response. However, I believe there might be a misunderstanding. The issue I'm experiencing is not distinct but rather a continuation of the problem discussed in #3019. If you refer to that thread, you'll notice that the problem described there is identical to mine, including the prompt to install the Prettier module.

Many users in this thread are suggesting the solution from #3019, and this issue is also considered a duplicate of that one. Therefore, I believe my issue is not separate but a persistent instance of the original problem.

I hope this clarifies the situation. I appreciate your understanding and assistance.

@Soviut
Copy link

Soviut commented Jun 23, 2023

Thank you for your response. I apologize for any confusion, but I was under the impression that this issue was still open as it doesn't explicitly state that it's closed.

It's closed in the timeline and says "Closed" at the top of the issue and in the header sticky header.

image

image

However, for this issue and #3019 all you need to do is fully restart VSCode after it's been updated to the latest version v1.79.2 (or later) AND the prettier plugin for VSCode has been updated to the latest version v9.16.0 (or later). If this doesn't work for some reason, restart your entire computer.

If it still doesn't work and you see a Prettier in the bottom right corner of VSCode is red, then start a new issue, paste your log and any relevant screenshots.

image

@Hibrix-net
Copy link

Thank you for your response. I apologize for any confusion, but I was under the impression that this issue was still open as it doesn't explicitly state that it's closed.

It's closed in the timeline and says "Closed" at the top of the issue and in the header sticky header.

image

image

However, for this issue and #3019 all you need to do is fully restart VSCode after it's been updated to the latest version v1.79.2 (or later) AND the prettier plugin for VSCode has been updated to the latest version v9.16.0 (or later). If this doesn't work for some reason, restart your entire computer.

If it still doesn't work and you see a Prettier in the bottom right corner of VSCode is red, then start a new issue, paste your log and any relevant screenshots.

image

Hi,
Yes, I already tried what you said several times but didn't worked. If you look at the issue #3019 its seems I'm not the only one who had to downgrade to a previous Prettier version to make it work.

Thanks anyway for your patience.

@ehoogeveen-medweb
Copy link
Contributor

@Hibrix-net Did you apply the prettier.prettierPath workaround from this issue? If so, remove it: The workaround broke extension version 9.16. This is being tracked in #3041.

@Hibrix-net
Copy link

@Hibrix-net Did you apply the prettier.prettierPath workaround from this issue? If so, remove it: The workaround broke extension version 9.16. This is being tracked in #3041.

Yes, I tried it then removed it but still having the issue with versions above the 9.10.4 + VS Code latest version installed on my Windows 10 machine.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging a pull request may close this issue.