jxnblk / mdx-deck

♠️ React MDX-based presentation decks
https://mdx-deck.jxnblk.com
MIT License
11.36k stars 603 forks source link

PDF export #347

Open Aetet opened 5 years ago

Aetet commented 5 years ago

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

bibliothek commented 5 years ago

I am facing the same issue.

jxnblk commented 5 years ago

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

Aetet commented 5 years ago

Yes, I have

filoxo commented 5 years ago

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.

gillchristian commented 5 years ago

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:

Relequestual commented 5 years ago

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

NightMachinery commented 4 years ago

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.