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

Updating to 3.2 breaks tailwind integration in production #10005

Closed
5 of 7 tasks
razzeee opened this issue Apr 1, 2024 · 17 comments · Fixed by #10012
Closed
5 of 7 tasks

Updating to 3.2 breaks tailwind integration in production #10005

razzeee opened this issue Apr 1, 2024 · 17 comments · Fixed by #10012
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@razzeee
Copy link
Contributor

razzeee commented Apr 1, 2024

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and 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:
image

Reproducible demo

https://github.com/flathub-infra/documentation

Steps to reproduce

  1. Checkout repo
  2. Run yarn
  3. Run yarn build
  4. Run yarn serve
  5. 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

Self-service

  • I'd be willing to fix this bug myself.
@razzeee razzeee added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 1, 2024
@Arhell
Copy link

Arhell commented Apr 1, 2024

more example
open-feature/openfeature.dev#489

@Airkro
Copy link

Airkro commented Apr 2, 2024

When using v3.2.0, plugins.configurePostCss(options) api not work anymore, maybe is the reason.

@SJFCS
Copy link
Contributor

SJFCS commented Apr 2, 2024

I had the same problem when I upgraded to version 3.2 that will lost tailwind css style after npm build, I look forward to a solution to this problem

@OzakIOne
Copy link
Contributor

OzakIOne commented Apr 2, 2024

I don't have any problem with Docusaurus V3 in this sandbox following this guide

https://stackblitz.com/edit/github-fvf5eb?file=src%2Fpages%2Findex.js

See my comment below

@OzakIOne OzakIOne closed this as not planned Won't fix, can't repro, duplicate, stale Apr 2, 2024
@OzakIOne OzakIOne added closed: can't repro This bug is because of some local setup that can't be reproduced. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 2, 2024
@Arhell
Copy link

Arhell commented Apr 2, 2024

I don't have any problem with Docusaurus V2 in this sandbox following this guide

https://stackblitz.com/edit/github-fvf5eb?file=src%2Fpages%2Findex.js

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 open-feature/openfeature.dev#489

Although, as mentioned above, everything works locally, but in production, alas. https://deploy-preview-489--openfeature.netlify.app/

@Arhell
Copy link

Arhell commented Apr 2, 2024

and this is for all projects where I updated dependencies yesterday
AvaloniaUI/avalonia-docs#436
openyurtio/openyurt.io#405

and everyone has the same problem, locally everything is fine, production is not

@OzakIOne
Copy link
Contributor

OzakIOne commented Apr 2, 2024

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

@OzakIOne OzakIOne reopened this Apr 2, 2024
@OzakIOne OzakIOne added bug An error in the Docusaurus core causing instability or issues with its execution and removed closed: can't repro This bug is because of some local setup that can't be reproduced. labels Apr 2, 2024
@slorber
Copy link
Collaborator

slorber commented Apr 2, 2024

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.

@heysokam
Copy link
Contributor

heysokam commented Apr 3, 2024

@slorber I've seen people report that the bug doesn't trigger on v3.1.0
Whatever broke it, it also fails in the same way with v3.1.1
I went back in history in my repository to a commit that I knew for a fact it worked, removed cache and node_modules to start fresh, and the bug still triggers
In fact, it started triggering with that version running without updating to 3.2.0

edit1:
It might be me calling the old repository by accident. I'm double checking, sorry
Will edit this comment again after confirming.

Edit2: Nope, nvm. It is triggering in v3.1.1 indeed
I removed, specifically, /build, /.docusaurus, /node_modules and package-lock.json to start fresh, and it still triggers.
A teammate tested on their computer, which had not updated since a long time ago, or reset anything, and they don't trigger the issue. We are trying to find why that is the case.

Edit3: It was triggering in ^3.1.1 specifically, which installed 3.2.0 for a reason unknown to our team. See my next comment.

@heysokam
Copy link
Contributor

heysokam commented Apr 3, 2024

Update: We were on ^3.1.1, but it was rounding up to 3.2.0 on install.
So false alarm, it triggers on v3.2.0, and works correctly in v3.1.0

@slorber
Copy link
Collaborator

slorber commented Apr 4, 2024

Can you please test canary 0.0.0-5886?
https://docusaurus.io/community/canary

It is the same as v3.2 (no breaking change, but this problem should be fixed)

@Arhell
Copy link

Arhell commented Apr 4, 2024

Can you please test canary 0.0.0-5886? https://docusaurus.io/community/canary

It is the same as v3.2 (no breaking change, but this problem should be fixed)

I checked it on all the projects that I support, everything works, only the one had problems with the plugin https://www.npmjs.com/package/docusaurus-plugin-image-zoom

but I think this is not a problem, I deleted it and everything worked, most likely it does not support the canary version or there is another problem.

Thanks for the work.

@razzeee
Copy link
Contributor Author

razzeee commented Apr 4, 2024

Canary seems to work for me too - but I also had to remove a dependency, cause it was expecting a docusaurus version bigger then 3.0

@slorber
Copy link
Collaborator

slorber commented Apr 4, 2024

Great 👍

I'll release soon

everything works, only the one had problems with the plugin npmjs.com/package/docusaurus-plugin-image-zoom

Maybe worth opening an issue on that plugin repo. I can't help if I don't know what the problem was.

Canary seems to work for me too - but I also had to remove a dependency, cause it was expecting a docusaurus version bigger then 3.0

Which dependency? Which version are you upgrading from? 2.x?

@razzeee
Copy link
Contributor Author

razzeee commented Apr 4, 2024

Canary seems to work for me too - but I also had to remove a dependency, cause it was expecting a docusaurus version bigger then 3.0

Which dependency? Which version are you upgrading from? 2.x?

Docusaurus 3.2 to the canary

Dependency is docusaurus-plugin-search-local

Probably caused by https://github.com/gabrielcsapo/docusaurus-plugin-search-local/blob/main/package.json#L97

gregberge added a commit to argos-ci/docs that referenced this issue Apr 4, 2024
@slorber
Copy link
Collaborator

slorber commented Apr 4, 2024

Ah, I see yes, it might prevent you from using a canary due to the 0.0.0 versions. I will try to figure out a solution to improve this.

@slorber
Copy link
Collaborator

slorber commented Apr 4, 2024

Fix released in v3.2.1

https://github.com/facebook/docusaurus/releases/tag/v3.2.1

zifeo added a commit to metatypedev/metatype that referenced this issue Apr 24, 2024
<!--
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 important for the users to get
readable changelog and understand when they need to update his code and
how.
-->

<!-- Explain WHAT the change is -->

#### Motivation and context

Fix the CSS issue introduced by docusaurus 3.2.0
(facebook/docusaurus#10005). 3.2.1 should fix
it but the affected version maybe loaded by dependencies, so we will
have to wait a bit more.

<!-- Explain WHY the was made or link an issue number -->


<!-- Explain HOW users should update their code when required -->

### Checklist

- [ ] The change come with new or modified tests
- [x] Hard-to-understand functions have explanatory comments
- [ ] End-user documentation is updated to reflect the change

---------

Co-authored-by: Natoandro <anatoandro@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants