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

[bug] [LSP Server] CJS configuration files in ESM projects cannot be cache busted on the server #142

Closed
spence-s opened this issue Mar 1, 2024 · 1 comment
Labels

Comments

@spence-s
Copy link
Collaborator

spence-s commented Mar 1, 2024

Internally, XO uses cosmiconfig to load configuration files.

In the case a project is ESM and the xo.config.cjs or .xo-config.cjs is used, the configuration file will not be invalidated until the server process is restarted, this means that the server cannot invalidate a cjs config on its own, the client must restart the process in that case.

This problem cannot be solved on the server and will remain a bug for anyone using the server directly:

CJS configuration files in ESM projects do not freshly import
Invalidate cache when using import #49442](nodejs/node#49442)

VSCode extensions users will automatically restart the server process from the client as a work around.

@spence-s spence-s added the bug label Mar 1, 2024
@spence-s spence-s changed the title CJS configuration files in ESM projects cannot be cache busted on the server [LSP Server] CJS configuration files in ESM projects cannot be cache busted on the server Mar 1, 2024
@spence-s spence-s changed the title [LSP Server] CJS configuration files in ESM projects cannot be cache busted on the server [bug] [LSP Server] CJS configuration files in ESM projects cannot be cache busted on the server Mar 2, 2024
@spence-s
Copy link
Collaborator Author

the extension now restarts on config change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant