Repository navigation
Closed
Description
🐛 Bug Report
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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
I am following the example of https://docusaurus.io/docs/markdown-features/react#importing-markdown and it fails
Have you read the [Contributing Guidelines on issues]
Steps to reproduce
- Clone https://github.com/hhimanshu/docusaurus-101
- yarn install and yarn start
Expected behavior
The app should have loaded correctly as per documentation
Actual behavior
The app fails with following error
Failed to compile
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <span>Hello {props.name}</span>
|
| This is text some content from `_markdown-partial-example.mdx`.
This error occurred during the build time and cannot be dismissed.
Your environment
- Public source code: https://github.com/hhimanshu/docusaurus-101
- Public site URL:
- Docusaurus version used:
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0):
- Operating system and version (e.g. Ubuntu 20.04.2 LTS):
Reproducible demo
Use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
(Paste the link to an example repo, including a docusaurus.config.js, and exact instructions to reproduce the issue.)
Activity
slorber commentedon Aug 4, 2021
hhimanshu commentedon Aug 4, 2021
Hey @slorber , the file I am trying to import is a relative import. See here
Ideally, I would like blogs to have folders like
But, I am not sure if this is a possibility
cveilleux commentedon Aug 4, 2021
I don't know if it is related, but we have started having build failures in the last 4 hours:
package.json:
I have a build that passed at 3pm today and is now failing at 6pm (same exact code-base).
Josh-Cena commentedon Aug 5, 2021
@cveilleux Can verify. Even the CI in this repo is failing:
https://github.com/facebook/docusaurus/pull/5284/checks?check_run_id=3247384304
Maybe you can open another issue as this looks like a different bug, but keeping it here is fine as well
lex111 commentedon Aug 5, 2021
Apparently a bug was in our dependency babel core, so they just released new version, which should fix this issue.
Try to reinstall all dependencies completely, removing your
node_modulesdirectory and lock file beforehand.slorber commentedon Aug 5, 2021
@hhimanshu there are 2 bugs here.
docs,blogorsrc/pagesfolder, unfortunately, other places likesrc/components/_markdownPartial.mdxdo not work.hhimanshu commentedon Aug 5, 2021
@slorber , I changed the location of
mdxfile AND also re-installed dependencies. I confirm that it work for me.Here is the commit
THANK YOU for all your help, very much appreciate it
slorber commentedon Aug 5, 2021
@hhimanshu with #5299 you should be able to put mdx files in
src/componentssoonhhimanshu commentedon Aug 5, 2021
Fantastic, thank you @slorber.