-
Notifications
You must be signed in to change notification settings - Fork 213
Plugins can't import tailwindcss/plugin
when using Standalone CLI or CDN
#1301
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
Comments
Hey! This is a known issue but I'm not sure how fixable this is for us currently. I added support for a "fallback" version of Tailwind CSS here: #1157 but knowingly left out support for Some details: Limitations in Node.js itself prevent us from intercepting these import / require calls easily. This seems to have been addressed in Node v23.6.0 by giving us experimental hooks for synchronous module loading. However, no version of Electron and by extension VSCode exists that is based on Node >= v23.6. As such I've not gone forward with trying to make this work. Even in the Standalone CLI where this does work, we actually use Bun and special builtin Bun APIs to make this function. They're not exactly equivalent to the new experimental Node APIs but ultimately enable similar functionality. I experimented a bit with using the experimental asynchronous module hooks (an older, existing API but more limited in some ways) in Node / Electron but I ran into roadblocks with this as well. It's something I plan to look into again. A workaround, although unfortunate, is to install |
Ah, usage of Bun makes so much sense now. I was getting odd flip-flopping of errors like So I ended up just adding a package.json to my assets directory and installing I think I'll have to add an Thanks. |
In case anyone stumbles upon this and needs a quick workaround.
{
"name": "assets",
"dependencies": {
"daisyui": "^5.0.16",
"tailwindcss": "^4.1.3"
}
}
- @plugin "../vendor/daisyui" {
+ @plugin "daisyui" {
- @plugin "../vendor/daisyui-theme" {
+ @plugin "daisyui/theme" {
- "assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
+ "assets.setup": [
+ "tailwind.install --if-missing",
+ "esbuild.install --if-missing",
+ "cmd --cd assets npm install"
+ ], This should now enable successful assets builds and allow the vscode extension to work. |
tailwindcss/plugin
when using Standalone CLI or CDN
What version of VS Code are you using?
v1.99.0
What version of Tailwind CSS IntelliSense are you using?
v0.14.13
What version of Tailwind CSS are you using?
Using bundled version of
tailwindcss
: v4.1.1What package manager are you using?
None
What operating system are you using?
macOS
Tailwind config
https://github.com/jtokoph/tailwind-phoenix-error-poc/blob/master/assets/css/app.css
VS Code settings
Reproduction URL
https://github.com/jtokoph/tailwind-phoenix-error-poc
Describe your issue
When starting with a default install of the Elixir Phoenix Framework, which uses the standalone tailwind cli along with a config-in-CSS approach, the extension fails to load with the error:
Error: Can't resolve 'tailwindcss/plugin'
The standalone version of the tailwind cli is able to compile without error.
Full log output here:
The text was updated successfully, but these errors were encountered: