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.

can't use with SSR because direct access to document property

See original GitHub issue

Hi.

If you try to build to server to get SSR, you will find this error:

Screen Shot 2022-01-10 at 09 49 02

A possible fix is check if the build is running for server or for browser: https://github.com/inertiajs/inertia/blob/master/packages/inertia/src/router.ts#L10

And only access the document property if is it running on browser.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
xiCO2kcommented, Jan 11, 2022

Awesome! let me know about the export named issue

0reactions
ibrunotomecommented, Jan 11, 2022

v0.5.0 should have the support for the SSR.

Let me know if that works.

yep, builded successfully. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Report Builder Access - SQL - Microsoft Learn
Configure Report Builder, a report design tool to use with a SQL Server Reporting Services report server.
Read more >
Implementing SSR in Next.js: Dynamic routing and prefetching
Since you are making use of dynamic routes, you should use the as prop that will contain the value of the route parameter....
Read more >
How do I detect whether I am on server on client in next.js?
Great answer! Adding a note, though, that if you're using Typescript and, like me, you get the error "cannot find name window", it...
Read more >
[Feedback] App Directory in Next.js 13 #41745 - GitHub
From the model I understand, if I am a bot which runs no JS, and make a request for your page, I want...
Read more >
Server-Side Rendering (SSR) - Vue.js
Let's take a look at the most bare-bones example of Vue SSR in action. ... code cannot assume access to platform-specific APIs, so...
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