Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jagretz opened this issue Sep 26, 2018 · 2 comments
Closed

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

jagretz opened this issue Sep 26, 2018 · 2 comments

Comments

@jagretz
Copy link

jagretz commented Sep 26, 2018

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
`-- [email protected]
@jagretz
Copy link
Author

jagretz commented Sep 26, 2018

Works fine using node v10.50 npm v6.1.0
It's possible the installation of node 8.2.1 messed up, or... maybe a minor issue with that version of node. I'll have to test this on another windows 10 machine tomorrow.

@jagretz
Copy link
Author

jagretz commented Sep 27, 2018

I had a co-worker try this on his Mac and ran into the same issue. I'll assume this is a problem with version node 8.2.1 and leave it at that.

I found this issue in the 8.3.0 changelog which points to this line.

Maybe that was the problem. Eitherway, i can use a different version of node for this project. Cheers

@jagretz jagretz closed this as completed Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant