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

[V4] Module dection not working in solid start #13194

Open
feledori opened this issue Mar 11, 2024 · 4 comments
Open

[V4] Module dection not working in solid start #13194

feledori opened this issue Mar 11, 2024 · 4 comments
Assignees

Comments

@feledori
Copy link

feledori commented Mar 11, 2024

What version of Tailwind CSS are you using?

v4.0.0-alpha.7

What build tool (or framework if it abstracts the build tool) are you using?

vite@5.1.5, vinxi@0.3.10

What version of Node.js are you using?

v20.11.1

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

Stackblitz Repro

Sadly not startable in a webcontainer as it can't load native addons but this is the minimal repro.

Describe your issue

As the new vite plugin analyzes the module graph it can't detect solid starts routes. Because solid supplies a FileRoutes component which determines what to display. This probably won't notify tailwind plugin about the files. You can see in the repro that Nav gets styled as it is directly imported, but anything in routes which gets added during compile won't be styled.

@feledori
Copy link
Author

Maybe a config for the vite plugin could solve this. Like suppling an options object:

{
 "outsideModuleGraph": "./src/routes/**/*.{ts,tsx,js,jsx}"
}

@oddcelot
Copy link

I tried a few things today with similar issues. The main one being the error:

Caution

Could not find css module ${pathToCssFileWhereTailwindIsImported}
(which is rendered multiple times)
This tends happen on initial start of the server.

When editing the file where tailwind is imported it seems the module is invalidated and the tailwind styles are applied.
Even when not having any tw-specific classes in one of the routes, the preflight should be at least applied, right?
This is not happening for me either.

Might this also be an issue with vinxi? (noticed server.moduleGraph is null at start, which might be a execution timing issue 🤷‍♂️)

let cssModule = server.moduleGraph.getModuleById(id)

@thecrypticace thecrypticace self-assigned this Mar 11, 2024
@oddcelot
Copy link

Small update
The error Could not find css module ${pathToCssFileWhereTailwindIsImported} seems fixed with 8123fa5 in v4.0.0-alpha.8

@AirBorne04
Copy link

Just made the suggested change @oddcelot and the styling issue is gone.

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

4 participants