-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Alpha v75 causes Markdown imports to exponentially increase compilation time, rendering my website impossible to compile #4713
Comments
Hey, webpack 5 dude here. Sorry to hear this is happening! I'll take a look for you. |
Can confirm, will be working to figure out why exactly this is. Sorry about that! |
@slorber As the error message implies, you have to first run |
@RDIL Thanks for looking, did you find anything? |
@Zamiell please don't assume I know anything about Python because I don't 😅 I had not planned to learn about how to make python 3 the default on macos or how to handle a Now it seems to work, but it was quite time-consuming to get there 😓 It seems your site builds, but there are a lot of broken links reported at the end, is this normal? |
Hey Slorber, thanks for taking a look. On MacOS, you simply use brew (i.e.
Yes, it is normal because in order to find the problem, I had to "comment out" (i.e. remove) the entire docs folder, and then just re-introduce one file, beginner.md. |
So, you upgraded from alpha 70 to alpha 75. The problem is also there on alpha74 (using Webpack 4), and it's not a Webpack 5 bug. I found out we have a very slow regex trying to extract a top-level doc markdown title, ignoring the mdx exports above it. Reported another bug report here for clarity: #4726, and going to close this one. A workaround to solve this regex problem is to add a md title above the MDX imports, or to not use MDX imports at the very top of the file.
This is useless title duplication, but fixes the perf problem for me. About your custom plugin, I suggest not importing our getFileLoader() utils and write your own svgr loader, as we are likely to change this: it is internal Docusaurus code, not public API. |
Awesome, thanks again for looking into this so quickly. |
That was me. I just wanted to avoid code duplication, since the svgr loader options in Docusaurus worked fine. |
Thanks for reporting this, was not easy to find the issue 😅 About the plugin, it's not a big deal but you'd rather duplicate a few lines rather than being subject to internal changes of Docusaurus. It's likely that this will change again |
Ideally, I'd query webpack itself for the options used to load svg files, except that I didn't find such API. Sure, we'll just instantiate svgr without calling into your internals, thanks for advice! |
🐛 Bug Report
In my Docusaurus website, I have import statements at the top of my Markdown files for the purposes of showing diagrams as React components. When upgrading to Docusaurus v75, these import statements make the development server impossible to start, as it hangs forever.
My website works completely fine on the previous version of 70.
Have you read the Contributing Guidelines on issues?
Yes.
To Reproduce
apt install python3
)pip install svgwrite
git clone git@github.com:hanabi/hanabi.github.io.git
cd hanabi.github.io.git
git checkout -b doc-bug
npm install
npm run start
npm run start
npm run start
Expected behavior
I expect my website to compile like it has been doing on previous versions of this software. On v70, it compiles in around 20 seconds with hundreds of import statements in around 30 different Markdown files.
Actual Behavior
The website does not compile.
The text was updated successfully, but these errors were encountered: