CLI and VS Code

I’ve switched from local Wix Editor to using VS Code and CLI integration.
All was working fine until I had to re-install Eslint and a few other node packages cos of other problems.
Re-integrating it all is working fine, except I’m getting every $w marked as undefined.
Does anyone know how $w is declared in the CLI package. It must be in one of the JSON config files. But which and how?
[Clearly ask your question.]

Product:
[Which editor or feature is your question most relevant to? e.g. Wix Editor, Wix Studio Editor.]

What are you trying to achieve:
[Explain the details of what you are trying to achieve. The more details you provide, the easier it is to understand what you need.]

What have you already tried:
[Share resources, forum topics, articles, or tutorials you’ve already used to try and answer your question.]

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

Have you synced the types?
wix sync-types

This should regenerate the .wix directory that hosts all the types

I didn’t know “wix sync-types” was a command I could use.
However, I tried it but there was no change.
My .wix folder contains an entry for each page (each with jsconfig.json and its .ts files). All looks good, but none contain an entry for $w (Its also complaining about $w.at).

Where should the $w type instructins be located?

.wix/types/wix-code-types/dist/types/common/$w.d.ts
.wix/types/wix-code-types/dist/types/page/$w.d.ts

OK. That file is there and looks good.
Any idea what is causing my problem then -

Could you show me the .jsconfig and .d.ts relevant to the page please?

Does this show only on a single page or all?

Sorry, had to step out for a few minutes. Here are files requested:




I haven’t looked at every file, but it does appear to be occurring throughout my site.

oops, should have been:

I don’t know if it is normal VS Code behaviour, but is looping trying to initialise all the Wix types: see screenshots:


Screenshot from 2024-10-31 12-39-06

Not really, try reloading the window

This config file: .wix/types/wix-code-types/configs/tsconfig.page.json
It should have: "types": ["dist/types/page"]

Which references .wix/types/wix-code-types/dist/types/page/index.d.ts
Which should have:

/// <reference path="../common/$w.d.ts" />
/// <reference path="./$w.d.ts" />

It does ave that entry. Index.d.ts has the following:


which includes your entries.

Then you have the types, there must be something missing for your IDE not to recognize it….