Skip to content

Can't npm start - destructured props - Unexpected token ...  #184

@jagretz

Description

@jagretz

This is odd, and I don't think it's a bug but i am receiving an error when trying to start mdx-deck and am having trouble finding a solution.

It appears node is having trouble with destructuring syntax.
[EDIT] I did make sure the version of node I'm using supports this syntax before opening the ticket.

This is a fresh install of mdx-deck in a new git project and I've already removed and reinstalled mdx-deck from npm and received the same error.

Code in question... node_modules\@mdx-js\mdx\mdx-hast-to-jsx.js:21

    node.properties = Object.entries(node.properties).reduce((properties, [key, value]) => ({
      ...properties,
      [paramCaseRe.test(key) ? paramCase(key) : key]: value,
    }), {})

Error

mdx-deck deck.mdx "-p" "3100"

[mdx-deck] starting dev server
× 「wdm」:
ERROR in ./deck.mdx
Module build failed (from ./node_modules/mdx-deck/lib/loader.js):
\node_modules\@mdx-js\mdx\mdx-hast-to-jsx.js:21
      ...properties,
      ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (\node_modules\@mdx-js\mdx\index.js:6:22)
 @ ./node_modules/mdx-deck/dist/entry.js 65:10-27
 @ multi ./node_modules/mdx-deck/dist/entry.js ./node_modules/mdx-deck/lib/overlay.js
[mdx-deck] listening on http://127.0.0.1:3100

meta info

Windows 10 (i can get the version if necessary)
node -v v8.2.1
npm -v 5.3.0
npm list mdx-deck
`-- mdx-deck@1.7.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions