I am having some difficulties importing LWC components from org to VSCODE. Is it the right way? Here's what I am following -
Yes, should work. Does your package.xml contain
<types>
<members>*</members>
<name>LightningComponentBundle</name>
</types>
Are you sure you're connecting to right org? If you Ctrl+Shift+P -> Open default org, do you land in the sandbox that contains this component? Any errors when you retrieve? sfdx
is installed ok?
Do you see your component if you open developer console, query tab, tick the Tooling API checkbox(!) and run SELECT DeveloperName FROM LightningComponentBundle
?
If all else fails you can query the bodies with Tooling API's SELECT Id, FilePath, Format, Source FROM LightningComponentResource
but it should "just work"...