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

app/utils is missing from generated content array in Nuxt 4 setup #955

Open
BayBreezy opened this issue Feb 11, 2025 · 5 comments
Open

app/utils is missing from generated content array in Nuxt 4 setup #955

BayBreezy opened this issue Feb 11, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@BayBreezy
Copy link

BayBreezy commented Feb 11, 2025

Environment

Reproduction

No response

Describe the bug

After setting future: { compatibilityVersion: 4 } in the nuxt.config file, and then run npm run dev, the generated config file inside .nuxt/tailwind/postcss.mjs is missing the path for app/utils/**/*.{js,ts,mjs}

It only has utils/**/*.{js,ts,mjs}

After setting app/utils/**/*.{js,ts,mjs} in the tailwind.config the styles from the utils folder started showing again.

/**@type {import('tailwindcss').Config} */
module.exports = {
  content: ["./app/**/*.{js,jsx,ts,tsx,vue}"]
}

Additional context

No response

Logs

@BayBreezy BayBreezy added the bug Something isn't working label Feb 11, 2025
@ineshbose
Copy link
Collaborator

Hm... it should be there as part of nuxt.options.imports

https://github.com/nuxt-modules/tailwindcss/blob/main/src/internal-context/load.ts#L70

@BayBreezy
Copy link
Author

It should be. It's the first time that I am seeing this behaviour and I have use it with several Nuxt 4 apps. This is what I see in the generated file

// generated by the @nuxtjs/tailwindcss <https://github.com/nuxt-modules/tailwindcss> module at 2/11/2025, 5:34:55 AM
import configMerger from "@nuxtjs/tailwindcss/merger";

import cfg2 from "./../../tailwind.config.js";
const config = [
{"content":{"files":["/PATH_TO_APP/app/components/**/*.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/components/global/**/*.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/components/**/*.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/layouts/**/*.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/pages/**/*.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/plugins/**/*.{js,ts,mjs}","/PATH_TO_APP/composables/**/*.{js,ts,mjs}","/PATH_TO_APP/utils/**/*.{js,ts,mjs}","/PATH_TO_APP/app/{A,a}pp.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/{E,e}rror.{vue,js,jsx,mjs,ts,tsx}","/PATH_TO_APP/app/app.config.{js,ts,mjs}"]}},
{},
cfg2
].reduce((acc, curr) => configMerger(acc, curr), {});

const resolvedConfig = config;

export default resolvedConfig;

This one right here: "/PATH_TO_APP/utils/**/*.{js,ts,mjs}" should be saying "/PATH_TO_APP/app/utils/**/*.{js,ts,mjs}"

@BayBreezy
Copy link
Author

Based on the line of code you linked, I am assuming Nuxt is not generating the paths propely?

But I am able to auto import stuff from the utils folder.. i don't know what's going on

@ineshbose
Copy link
Collaborator

Sorry, I see that composables is not pointing to app/ either.. I see based on next line:

https://github.com/nuxt-modules/tailwindcss/blob/main/src/internal-context/load.ts#L71

there may have been a conflict. Will fix this in next patch 🙏

@BayBreezy
Copy link
Author

Sounds good. TY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants