Giter Site home page Giter Site logo

Comments (8)

jovezhong avatar jovezhong commented on April 28, 2024 3

Hi @slorber , I just reported back my finding.

The issue was solved

  • I tried kind of 'binary-search', to go back 2 months ago, see whether it worked, then 1 months ago, 2w ago, etc
  • I located the commit for introducing GA4 https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-google-gtag
  • But I do need to use GA4 and I found if I delete the yarn.lock and yarn install again to regenerate it, the problem is gone
  • So I went back to my latest code, regenerated the yarn.lock (not via yarn install, delete it first) and the issue is solved.

I guess there could be some duplicated lib in the old yarn.lock and GA4 dependencies just made things worse. A clean deps is the key.

Nothing wrong with docusaurus or the docusaurus/plugin-google-gtag

from docusaurus.

slorber avatar slorber commented on April 28, 2024

Documented as a v3.0 breaking change:
https://docusaurus.io/docs/migration/v3#prism-react-renderer-v20

from docusaurus.

jovezhong avatar jovezhong commented on April 28, 2024

Hi @slorber , the syntax highlight was working when I upgraded to v3 (I followed that migration guide and added the additional languages). But recently got this issue

from docusaurus.

slorber avatar slorber commented on April 28, 2024

So you did something that broke it probably, and need to figure out what. As you said, it works on v3 πŸ˜…

from docusaurus.

jovezhong avatar jovezhong commented on April 28, 2024

Thanks for the reply. I tried to a few older version of prism and cannot get it back working. Appreciate if you can share any debug/troubleshooting tips. I don't see JS error about this, nor the build error. DOM elements seem to be okay. Not a burning issue but would like to fix it. Also the copy button was missing recently.

from docusaurus.

slorber avatar slorber commented on April 28, 2024

You should checkout older commits one by one until it works again to know which commit broke your site highlighting.

If the copy button doesn't show, it's probably that you did something reading to prism and our theme code block not even being used at all. Are you even seeing a non SQL code block being highlighted on any page?

Are you able to highlight SQL on a newly initialized site? If not, then it's a bug you should report.

Your monorepo setup is weird. We usually use workspaces and do not declare dependencies at the root. It's not possible for me to spend time investigating a monorepo setup like this, because any package/dependency can cause issue with Docusaurus. Try isolating your site in a single repo with proper dependencies and see if it works better.

from docusaurus.

jovezhong avatar jovezhong commented on April 28, 2024

Thanks @slorber for the reply. Yes, I guess the best way is to kind of git blame and try different versions to locate when this is broken. Not just SQL block, other bash/js/python code blocks are not working.

You mentioned the monorepo setup, but https://github.com/timeplus-io/docs is a repo only for the docs. I think I created it via Docusaurus CLI or template (cannot remember the details, it was 2-3 years ago)

The dependencies are only for Docusaurus.

Again, I will try 'time travel' back to the commit a few months ago, then do some kind of binary search to try to locate which commit breaking the code highlight (check out certain commit, yarn install, yarn run start)

from docusaurus.

slorber avatar slorber commented on April 28, 2024

Sorry I mistakenly saw a weird monorepo, that was probably another repro posted yesterday.

from docusaurus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.