Open karanrajpal14 opened 6 years ago
Thanks! That's definitely a bug. I think I have a fix in #20 if you wanna try installing the latest version
Hey thanks for attempting to fix it! I do think the issue is resolved for the case I specified but there is one other case I would like to mention and highlight another issue I am facing.
The mdx file does seem to be compiling but, I do not see any content on the page right now. I just have # Hello
in the index.mdx
file right now.
I only see a blank page with the following error in the console
Uncaught TypeError: Cannot read property 'Root' of undefined
at eval (routes.js:126)
at Module../client/routes.js (main.js:1876)
at __webpack_require__ (main.js:768)
at fn (main.js:131)
at eval (App.js:11)
at Module../client/App.js (main.js:1756)
at __webpack_require__ (main.js:768)
at fn (main.js:131)
at eval (index.js:8)
at Module../client/index.js (main.js:1840)
Any idea what's going on here?
Also, the second case that I mentioned. Is it necessary to have the mdx files inside another folder? In my case, I will most likely need just one mdx file and some components from BloomerJS. If I do place the index.mdx
file in the root directory, it picks up the README.md
files from the node_modules
directory and errors out. What do you think? It's not a big deal but just something to consider if you've got the time.
Glad that the original issue was resolved. For your second question, mdx-go uses webpack's require.context
to pick up all files that end in .js
, .md
or .mdx
, so it's recommended you use it on a folder that doesn't contain node_modules
. I'm looking into other ways to specify which files it picks up, but for now I'd recommend making a separate docs
folder or similar
Ah! That makes sense. I'll stick to the recommended structure if that's the case. Any idea what's the issue with rendering the mdx though? That error does not seem to be going away irrespective of what I do and I always see a blank page and nothing more.
docs
folderok so you must have a docs/index.md
or docs/index.mdx
... you can not simply have only docs/readme.md
, or just docs/README.md
The issue keeps happening:
WAIT Compiling... 3:36:46 PM
✔ success [mdx-go] compiled in 195ms
ERROR Failed to compile with 1 errors 3:36:47 PM
error in /home/v1rtl/.local/pnpm/pnpm-global/3/node_modules/.pnpm/registry.npmjs.org/mdx-go/2.0.0-32/node_modules/mdx-go/lib/client/keyboard-shortcuts.md
Module parse failed: Unexpected character '#' (2: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
|
> ### Keyboard Shortcuts
|
| - `/`: Show directory listing
I've been trying to get this to work for a while now but, unfortunately, I haven't had the luck. Firstly, the directory structure looks like this:
I cd to this directory and run
mdx-go docs
and get the following error:Any idea why it's breaking due to a file that isn't even present in the directory? Is there something wrong on my end that I need to change? Please do let me know.