Skip to content

fix(docs): import right package for proper type hints #80767

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

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

yeskunall
Copy link
Contributor

@yeskunall yeskunall commented Jun 22, 2025

If you want type-hints for your PostCSS config, then you must import it from postcss-load-config, not tailwindcss.

This does mean you’ll have to install postcss-load-config as a devDependency, but nonetheless the current doc imports the types for TailwindCSS’s config which I believe is incorrect.


💖

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Jun 22, 2025
@ijjk
Copy link
Member

ijjk commented Jun 22, 2025

Allow CI Workflow Run

  • approve CI run for commit: bab88b3

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@ijjk
Copy link
Member

ijjk commented Jun 22, 2025

Allow CI Workflow Run

  • approve CI run for commit: bab88b3

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@icyJoseph
Copy link
Contributor

Hi, thanks for the PR, I think this was caused during the Tailwind 4 release days.

You can see how everything around your fix was changed from Tailwind 3's tailwind.config.js file, to the postcss.config.mjs file

Thanks for the submission.

@@ -23,7 +23,7 @@ npm install -D tailwindcss @tailwindcss/postcss postcss
Create a `postcss.config.mjs` file in the root of your project and add the `@tailwindcss/postcss` plugin to your PostCSS configuration:

```js filename="postcss.config.mjs" highlight={4}
/** @type {import('tailwindcss').Config} */
/** @type {import('postcss-load-config').Config} */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I don't love about this one is that, we never mention that you should install postcss-load-config, so people doing this would get any type.

  • I wonder if it makes sense to delete this line altogether,
  • or, add a small subsection further down, explaining that if you want to get type hints for the config, then you need to install this extra package, and add this JSDoc comment.

I am not sure how many people are going to be updating their postcss.config.mjs file, enough to need type hints and such, at the cost of yet another dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to delete this line altogether

I think this makes more sense based on what you said after about adding an additional dependency. So, if you’d like I can simply remove that line.

LMK and I’ll update the PR accordingly. Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to Next.js' official documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants