docusaurus: Updating to 3.2 breaks tailwind integration in production
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
Upgrading to 3.2 broke the tailwind styling, which I’ve integrated according to https://medium.com/@bargadyahmed/docusaurus-a-guide-to-seamless-integration-with-tailwind-css-dd202211caac
Here I’ve added the banner-preview with the custom tailwind integration flathub-infra/documentation@e0dc841 (#272)
It still works fine in dev, but breaks in prod or locally - if I do yarn build and then yarn serve. Unfortunatly the production errors are not helpful.
Basically https://docs.flathub.org/banner-preview/ should be styled. Like this:
Reproducible demo
https://github.com/flathub-infra/documentation
Steps to reproduce
- Checkout repo
- Run
yarn - Run
yarn build - Run
yarn serve - Goto http://localhost:3000/banner-preview
Expected behavior
The page should be styled like in the above image
Actual behavior
The page isn’t styled, presumably because tailwind isn’t working, after upgrading to 3.2
Your environment
- Public source code: https://github.com/flathub-infra/documentation
- Public site URL: https://docs.flathub.org/
- Docusaurus version used: 3.2
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Shouldn’t apply as it’s run on github
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Shouldn’t apply as it’s run on github
Self-service
- I’d be willing to fix this bug myself.
About this issue
- Original URL
- State: closed
- Created 3 months ago
- Reactions: 1
- Comments: 17 (5 by maintainers)
Commits related to this issue
- chore: downgrade from v3.2.0 to v3.1.1 Cause it breaks Tailwind CSS support https://github.com/facebook/docusaurus/issues/10005 — committed to argos-ci/docs by gregberge 3 months ago
- fix: website and headline (#691) <!-- Pull requests are squash merged using: - their title as the commit message - their description as the commit body Having a good title and description is im... — committed to metatypedev/metatype by zifeo 2 months ago
Thanks for reporting, it’s probably a mistake I did when refactoring things to improve performance.
I’ll take a look soon and publish a fix ASAP.
When using v3.2.0, plugins.configurePostCss(options) api not work anymore, maybe is the reason.
Fix released in v3.2.1
https://github.com/facebook/docusaurus/releases/tag/v3.2.1
Ah, I see yes, it might prevent you from using a canary due to the
0.0.0versions. I will try to figure out a solution to improve this.Oops my bad, I forgot after trying to reproduce with the base guide the problem is in production
Indeed I have the same error in the sandbox with version 3.2.0 and no issue in version 3.1.0 i’ll try to take a look
3.2.0 sanbox dev no issue, prod issue
3.1.0 sandbox dev and prod no issue
and this is for all projects where I updated dependencies yesterday https://github.com/AvaloniaUI/avalonia-docs/pull/436 https://github.com/openyurtio/openyurt.io/pull/405
and everyone has the same problem, locally everything is fine, production is not
Thanks for the example, but it’s not very clear why everything works in the https://openfeature.dev/ version. https://github.com/open-feature/openfeature.dev/blob/main/docusaurus.config.ts#L279
And after updating the dependencies there are no https://github.com/open-feature/openfeature.dev/pull/489
Although, as mentioned above, everything works locally, but in production, alas. https://deploy-preview-489--openfeature.netlify.app/