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.

v1.0.0-rc.* Compiled with errors: Module parse failed: Unexpected token

See original GitHub issue

Bug Report

Describe the bug

When I try to run docz dev I get multiple errors regarding an appropriate loader

✖ Docz
  Compiled with some errors in 29.12s



 ERROR  Failed to compile with 3 errors              12:00:39 PM

 error  in ./node_modules/docz/dist/index.esm.js

Module parse failed: Unexpected token (15:38)
You may need an appropriate loader to handle this file type.
| import { MDXProvider } from '@mdx-js/tag';
|
> const BasePlayground = loadable(() => import('./chunk.esm2.js'));
| const Playground = props => typeof window !== 'undefined' ? (createElement(Suspense, { fallback: null },
|     createElement(BasePlayground, Object.assign({}, props)))) : null;

 @ ./.docz/app/root.jsx 9:0-59 17:2-15 20:19-23 27:25-31
 @ ./.docz/app/index.jsx
 @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./.docz/app/index.jsx

 error  in ./node_modules/docz-theme-default/dist/index.esm.js

Module parse failed: Unexpected token (245:30)
You may need an appropriate loader to handle this file type.
| `;
|
> const CodeMirror = lazy(() => import('./chunk.esm2.js'));
| const getLanguage = (children) => {
|     const defaultLanguage = 'jsx';

 @ ./.docz/app/root.jsx 11:0-39 18:29-34
 @ ./.docz/app/index.jsx
 @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./.docz/app/index.jsx

 error  in ./.docz/app/imports.js

Module parse failed: Unexpected token (8:11)
You may need an appropriate loader to handle this file type.
| export var imports = {
|   'src/index.mdx': function srcIndexMdx() {
>     return import(
|     /* webpackPrefetch: true, webpackChunkName: "src-index" */
|     'src/index.mdx');

 @ ./.docz/app/root.jsx 12:0-36 28:13-20
 @ ./.docz/app/index.jsx
 @ multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./.docz/app/index.jsx

Environment

  • node v10.15.1
  • npm v6.8.0
  • react v16.8.4
  • npm ls webpack ├─┬ docz@1.0.0-rc.3 │ └─┬ docz-core@1.0.0-rc.3 │ └── webpack@4.29.6 └─┬ react-scripts@2.1.8 └── webpack@4.28.3

Additional context/Screenshots

Screenshot 2019-03-22 at 12 03 25

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:12
  • Comments:35 (6 by maintainers)

github_iconTop GitHub Comments

26reactions
sanohincommented, May 9, 2019

Also instead of installing webpack@4.28.2, you can specify it in resolutions in package.json

"resolutions": {
    "docz/**/webpack": "4.28.4"
}
19reactions
jacobjonssoncommented, Jun 11, 2019

Switching back to Storybook… such a waste of time.

No need to add those comments, the maintainer is doing a great job and does not deserve comments like that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module parse failed: Unexpected token (257:106) You may ...
After running 'npm update' on my app, I am suddenly getting the following error: Compiled with problems: ERROR in ./node_modules/pako/lib/zlib/ ...
Read more >
Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
I am receiving this error message: Failed to compile. ./src/pages/tracks.js 43:10. Module parse failed: Unexpected token (43:10)
Read more >
App.vue “Module parse failed: Unexpected token (1:0)” - MSDN
ERROR in ./src/App.vue 1:0. Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type.
Read more >
Storybook error - "ModuleParseError: Module parse failed
It seems that after that, I started getting the following error when I ... [built] ModuleParseError: Module parse failed: Unexpected token ...
Read more >
Webpack build error - Questions - Babylon.js Forum
Failed to compile. ./node_modules/@babylonjs/core/Misc/environmentTextureTools.js 100:39 Module parse failed: Unexpected token (100:39) File ...
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