-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
ESM and TypeScript version of PostCSS config, doesn't load. #47774
Comments
I had the same problem |
It's an upstream issue related to Apparently, according to this code on the repository: No pattern ends with a |
@xeho91 thanks for the issue webpack-contrib/postcss-loader#631 and PR webpack-contrib/postcss-loader#632 ! I'm guessing this version of |
Wohoo, I contributed to the Next.js! Well, not indirectly. |
Hmm... I may be wrong in my assumption above that it will be directly vendored in. Looking a bit deeper into the Next.js codebase, it seems that the config file resolution for PostCSS is here in Next.js (only JSON + CommonJS supported): next.js/packages/next/src/lib/find-config.ts Lines 9 to 27 in da37c01
|
I am unsure, but from the snippet you provided, I think it's only about loading the Next.js config. This is what I could find in relation to PostCSS loader, however I have no idea how the dependency is resolved. I would be happy to provide a PR. However, I need a clue from the Next.js team. How is this |
It does look like it at first glance, but in my debugging, this is the function that was in the stack trace when it failed after I added an ESM |
Anyone works on this yet, would be a cool feature |
The same question. |
Postcss and postcss/postcss-load-config added support for .ts and esm in postcss-load-cofing v5, but still doesnt work in NextJS. You can check more about Postcss here in this PR - postcss/postcss-load-config#249. |
Support for ESM (e.g. |
Verify canary release
Provide environment information
> npx next info Operating System: Platform: linux Arch: x64 Version: Ubuntu 20.04.0 LTS Sat Apr 01 2023 08:47:57 GMT+0800 (Taipei Standard Time) Binaries: Node: 16.14.2 npm: 7.17.0 Yarn: 1.22.19 pnpm: 7.13.6 Relevant packages: next: 13.2.5-canary.24 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
TypeScript
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-p7yaj5?file=pages/index.tsx
To Reproduce
npm install -D tailwindcss
npx tailwindcss init --esm --postcss --ts
Describe the Bug
Since TailwindCSS as of version
^3.3.0
supports ESM and TypeScript config, thepostcss.config.ts
doesn't load at all - the content of the config file is not read up - I could confirm by adding aconsole.log()
with a random message.Expected Behavior
The PostCSS of config - ESM or TypeScript - should load. Hence the styles of the heading message should be applied.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: