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

Initialization fails in a v4 project with invalid CSS #1121

Open
thecrypticace opened this issue Jan 11, 2025 · 1 comment
Open

Initialization fails in a v4 project with invalid CSS #1121

thecrypticace opened this issue Jan 11, 2025 · 1 comment
Assignees

Comments

@thecrypticace
Copy link
Contributor

thecrypticace commented Jan 11, 2025

We "discover" projects in a workspace and then initialize projects for every open document. Most of the time this is the same project.

However, if that project fails to initialize it's marked as disabled then it's re-initialized failing again. This registers several watchers and other resources. We should instead:

  • Collect all unique projects for open documents
  • Initialize those projects
  • Work on a mechanism to recover from errors when loading the design system. This includes @utility or @variant being in a nested spot, failure to load a plugin or config, failure to load an import, failure to parse an imported stylesheet, errors caused by invalid @applys, etc…

This will definitely require some work in v4 core's __unstable_loadDesignSystem(…). We'll likely need to introduce some time of "error recovery" mode that can capture errors and proceed even when an error happens.

For example:

  • Plugins can just not be loaded
  • Ditto with configs
  • Missing / failed imports can be replaced with an empty AST
  • Missing classes in an @apply can be omitted

We should also find a way to record these errors so they can be surfaced to the user

We also need to surface the CSS graph information outside of project discovery so we can provide graph-aware diagnostics.

For example, if a user import's a file into a layer that has @utility we need to provide a diagnostic for this.

@thecrypticace thecrypticace self-assigned this Jan 11, 2025
@stijns96
Copy link

I indeed experience lots of issues at the moment with intellisense. Initially I thought it was perfectly working, but now I opened my project and nothing works anymore.

Is the issue clear and can it be fixed soon, or are there some unknowns that have to be checked first?

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

No branches or pull requests

2 participants