question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server Side Rendering Support

See original GitHub issue

If you use it along next.js, the server side compiling process fails because of a reference error: ReferenceError: document is not defined at new FocusOutlineManager (node_modules/focus-outline-manager/focus-outline-manager.js:34:5) at Object.<anonymous> (node_modules/focus-outline-manager/focus-outline-manager.js:84:1) at Module._compile (internal/modules/cjs/loader.js:701:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal/modules/cjs/loader.js:539:12) at Function.Module._load (internal/modules/cjs/loader.js:531:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (node_modules/reactour/dist/reactour.cjs.js:7:1) Using it with dynamic import works:

const Tour = dynamic( () => import('reactour'), { ssr: false } )

But you can not test it in a storybook and separate the component from the SSR Framework (it should work on any SSR framework).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
torleifhalsethcommented, Jan 15, 2020

I solved this issue using react-loadable in Gatsby SSR context. Example:

import Loadable from 'react-loadable';

const Tour = Loadable({
  loader: () => import('reactour'),
  loading: () => null,
});

Thanks for the awesome package @elrumordelaluz 💯

0reactions
andrewmclagancommented, Mar 27, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is server-side rendering: definition, benefits and risks
Server -Side Rendering (SSR) is an approach to rendering content for the website. Learn the benefits, drawbacks and frameworks of server-Side ...
Read more >
What is server-side rendering and how does it improve site ...
Server -side rendering ensures that website content appears quickly, without first having to download and run application code.
Read more >
Client-side vs. server-side rendering: why it's not all black and ...
Server -side rendering is the most common method for displaying information onto the screen. It works by converting HTML files in the server...
Read more >
The Benefits of Server Side Rendering Over Client ... - Medium
While the page is rendered earlier and the customer can see the page sooner, they can't really interact with it until react is...
Read more >
Take advantage of these 5 benefits of server-side rendering
What are some potential benefits of server-side rendering? Data security, compliance, minimized latency, predictable performance, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found