question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to compile, unexpected character '#'

See original GitHub issue

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:

├── docs
│   └── res.mdx
├── node_modules
│   ├── bloomer
│   ├── classnames
│   └── tslib
├── package.json
└── package-lock.json

I cd to this directory and run mdx-go docs and get the following error:

➜ mdx-go docs 
[mdx-go] starting dev server...
✔ success [mdx-go] compiled in 1s 848ms


 ERROR  Failed to compile with 1 errors                                 19:30:57

 error  in /home/karan/.nvm/versions/node/v8.11.4/lib/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.
| 
> ### Keyboard Shortcuts
| 
| - `/`: Show directory listing

 @ /home/karan/.nvm/versions/node/v8.11.4/lib/node_modules/mdx-go/lib/client/routes.js 11:0-56 44:26-43
 @ /home/karan/.nvm/versions/node/v8.11.4/lib/node_modules/mdx-go/lib/client/App.js
 @ /home/karan/.nvm/versions/node/v8.11.4/lib/node_modules/mdx-go/lib/client/index.js
 @ multi webpack-hot-middleware/client /home/karan/.nvm/versions/node/v8.11.4/lib/node_modules/mdx-go/lib/client/index.js

✖ 「wdm」: 
ERROR in ./client/keyboard-shortcuts.md 2:0
Module parse failed: Unexpected character '#' (2:0)
You may need an appropriate loader to handle this file type.
| 
> ### Keyboard Shortcuts
| 
| - `/`: Show directory listing
 @ ./client/routes.js 11:0-56 44:26-43
 @ ./client/App.js
 @ ./client/index.js
 @ multi webpack-hot-middleware/client ./client/index.js
[mdx-go] listening on http://localhost:8080
^C

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.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jxnblkcommented, Oct 9, 2018

Thanks! That’s definitely a bug. I think I have a fix in #20 if you wanna try installing the latest version

0reactions
talentlessguycommented, May 28, 2020

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected character, when importing or accessing docx file ...
Failed to compile Module parse failed: Unexpected character, when importing or accessing docx file reactjs.
Read more >
Error Module parse failed: Unexpected character '
Hello, I get errors when I comple with webpack. ERROR in ./node_modules/vx-easyui/dist/themes/icons/filesave.png 1:0. Module parse failed: ...
Read more >
Can't build with webpack - Material Design for Bootstrap
css 1:0 Module parse failed: Unexpected character '@' (1:0) You may need an appropriate loader to handle this file type, currently no loaders...
Read more >
Module parse failed: Unexpected character '@' (1:0) with ...
Coding example for the question Module parse failed: Unexpected character '@' (1:0) with Storybook 6.1.11, Webpack 5.11.0, React 17.0.1-Reactjs.
Read more >
Fontsource Error - Unexpected character '@' - Roots Discourse
build.rules.css.setInclude([app.path()]);. Try to load modules from the source directory or the node_modules ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found