Giter Site home page Giter Site logo

Comments (8)

slorber avatar slorber commented on May 2, 2024 1

This works for me:

CleanShot 2024-04-12 at 12 12 53@2x

Your website declares "@mdx-js/react": "3.0.0", this leads to your repo having twice that package being loaded, not deduplicated, which is the problem.

CleanShot 2024-04-12 at 12 14 23@2x

Use "@mdx-js/react": "^3.0.1", and ensure there is no duplicate version of that package instead:

CleanShot 2024-04-12 at 12 14 36@2x

Then it works

from docusaurus.

Josh-Cena avatar Josh-Cena commented on May 2, 2024 1

Because MDX doesn't. πŸ€·β€β™‚οΈ We don't implement Markdown compilation; MDX does. If MDX doesn't tell us something went wrong, there's nothing we can do.

from docusaurus.

OzakIOne avatar OzakIOne commented on May 2, 2024

I tried reproducing your issue in a minimal repro and I couldn't reproduce the bug. Am I missing something ?

https://stackblitz.com/edit/github-gesjj3?file=package.json

from docusaurus.

davidzwa avatar davidzwa commented on May 2, 2024

I tried adjusting your stackblitz (completely aligning all versions), but could also not reproduce the problem there.

The difference I see between your and my project is Typescript. You've generated a javascript based docusaurus repro.
I've spun up a TS based project locally and I am able to reproduce the problem (a separate project with default tsconfig/docusaurus config).

from docusaurus.

davidzwa avatar davidzwa commented on May 2, 2024

I've checked locally: the docusaurus build output contains the (seemingly unrendered) component in the html page.

<admonition type="danger"><p>hello</p></admonition>

In the stackblitz the html output looks like:

<div class="theme-admonition theme-admonition-danger admonition_xJq3 alert alert--danger">
   <div class="admonitionHeading_Gvgb">
      <span class="admonitionIcon_Rf37">
         <svg viewBox="0 0 12 16">
            <path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path>
         </svg>
      </span>
      danger
   </div>
   <div class="admonitionContent_BuS1">
      <p>hello</p>
   </div>
</div>

At least this seems to explain what causes the warning in the console.

from docusaurus.

davidzwa avatar davidzwa commented on May 2, 2024

Due to using an automated version management system (Renovate Mend), version pinning is crucial to my repo. Therefore, this solution is not a viable one for me.

I have removed @mdx-js/react from my packages. This gave compilation errors before, but for some reason it does work now.

from docusaurus.

Josh-Cena avatar Josh-Cena commented on May 2, 2024

@davidzwa You could still use version pinning. All you need to do is to make sure you are using the same version of @mdx-js/react that Docusaurus is using, i.e. 3.0.1 in this case. Or you can ask Renovate to upgrade it for you.

from docusaurus.

davidzwa avatar davidzwa commented on May 2, 2024

The problem is that Renovate did upgrade it before, but I suppose it did not resolve the lock file properly causing two versions to appear. I'm not sure what to do about that and I feel its not a problem to be discussed here.

The truth is: Its annoying that no compilation error is thrown, so a simple docusaurus build action won't cause the PR to be stopped. That's would be an improvement that can still be discussed and therefore this issue is still relevant.

Why does the admonition block not throw a compilation error?

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.