Comments (8)
This works for me:
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.
Use "@mdx-js/react": "^3.0.1",
and ensure there is no duplicate version of that package instead:
Then it works
from docusaurus.
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.
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.
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.
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.
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.
@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.
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)
- Document solution to "docs last update" date being rendered incorrectly when published through Vercel
- Customizing admonitions not work HOT 3
- When testing on StrictMode, the bar remains on the top HOT 1
- Node.js building getting stuck HOT 2
- The <!--truncate--> line in my long blog post on the initialized website is not causing the blog post size to be limited. HOT 1
- Add trailing slash to auto generated sitemap.xml for directories only HOT 3
- blogTitle not working HOT 4
- Algolia Contextual Search Generates Incorrect FaceFilters HOT 6
- Multi-Instance Routes Not Working in v3.2.1 HOT 3
- Home page renders twice, one below the other. HOT 1
- Details elements aren't searchable - a11y issue HOT 8
- WARNβ 1 deprecated subdependencies found: [email protected] HOT 1
- npm run build fails when nmetadata are missing HOT 3
- Broken link transformation HOT 2
- Ability to Skip Homepage and Directly Access Feature Page HOT 1
- Light/Dark Mode issues on older versions of Safari 12,13, and 14 HOT 3
- Problems with locale url on homepage and blog HOT 5
- Proposal: createSitemapItems hook - a sitemap equivalent to createFeedItems
- Blob storage files render dynamically HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docusaurus.