Mdx-deck: PDF export

Created on 22 Apr 2019  Â·  7Comments  Â·  Source: jxnblk/mdx-deck

Hello.
When I try to export my presentation like:

 mdx-deck-export pdf history.mdx

I have following error:

 ERROR  Failed to compile with 1 errors                                                                                                       20:56:34

 error  in ./node_modules/mdx-deck/index.js

Module parse failed: Unexpected token (2:9)
You may need an appropriate loader to handle this file type.
| export * from '@mdx-deck/components'
> export * as themes from '@mdx-deck/themes'
| export * as Layouts from '@mdx-deck/layouts'
| 

presentation file:
https://github.com/Aetet/history/blob/master/history.mdx

Most helpful comment

Yes, I have

All 7 comments

I am facing the same issue.

Thanks! Do you have both mdx-deck and @mdx-deck/export installed as development dependencies locally?

Yes, I have

I worked around this by manually modifying /node_modules/mdx-deck/index.js with named exports

export * from '@mdx-deck/components'
import * as themes from '@mdx-deck/themes'
import * as Layouts from '@mdx-deck/layouts'

export {
  themes,
  Layouts
}

then mdx-deck-export pdf deck.mdx worked.

Doesn't work for me either, tried @filoxo suggestion but still same error

EDIT: Never mind, it did work. I had a typo :man_facepalming:

This was applicable to v2. Is it still applicable to v3? I haven't been able to test v3 yet.

Adding some example exported decks to the readme is essential. I personally came here and wasn’t at all reassured of the portability of presentations made by this software. Adding “/print” to the demo also only showed the first slide on my ipad.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Irev-Dev picture Irev-Dev  Â·  4Comments

busypeoples picture busypeoples  Â·  4Comments

dance2die picture dance2die  Â·  5Comments

marcysutton picture marcysutton  Â·  4Comments

jxnblk picture jxnblk  Â·  4Comments