Import Spectacle in server-side
See original GitHub issueI want to use next.js to render a presentation with spectacle, but I get an error because the hash history is used.
Hash history needs a DOM
Invariant Violation: Hash history needs a DOM
at invariant (/home/romelperez/projects/prhone/romelperez.com/node_modules/invariant/invariant.js:42:15)
at createHashHistory (/home/romelperez/projects/prhone/romelperez.com/node_modules/history/createHashHistory.js:69:27)
at Object.<anonymous> (/home/romelperez/projects/prhone/romelperez.com/node_modules/spectacle/lib/utils/controller.js:50:47)
at Module._compile (module.js:643:30)
at Module._compile (/home/romelperez/projects/prhone/romelperez.com/node_modules/source-map-support/source-map-support.js:492:25)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
I don’t mind not rendering it from the server, but I need it to work in the client.
Is there any workaround?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Next.js - import server-side package in a file contains both ...
Show activity on this post. Just copy & paste the contents of your file into it & you'll see which code gets bundled...
Read more >Importing photos and videos - Spectacles Support
Once your Spectacles are paired with your phone, they can wirelessly import your 3D photos and videos (also known as “Snaps”) into Snapchat....
Read more >Customs Ruling HQ 963785 - Classification of eyeglass cases
The spectacle cases may be imported with spectacle frames made of gold tone metal and as presented these frames have “demonstration” lens inserts....
Read more >Fork Repository and Import Application for the Server-side ...
Import the application into your PDI from your fork of the repository. IMPORTANT: If you have already forked and imported the repository, you...
Read more >HS Codes of Heading 9003 - Cybex Exim
We are a B2B Research based Advisory firm helping Export Import companies to grow their ... HS Codes of Heading 9003 : FRAMES...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
SSR support would be excellent, conditional require in componentDidMount is obviously not great on performance
Edit: Why not assume you’re on the first slide on the server, then goto the correct slide in the DOM if the hash is different? In most cases, the initial render where SSR comes into play will be the beginning.
@dharmeshkakadia you do not import anything from spectacle manually, you should utilise (like I use
Deck
from the callback argument) render prop’s callback’s arguments which reflects spectacle’s exports and they are:and I dont see
createTheme
in this list