Skip to content

Collecting page data .[ReferenceError: window is not defined] , in nextjs15 #74428

Closed Answered by icyJoseph
ahmerarain asked this question in App Router
Discussion options

You must be logged in to vote

You don't need those checks in the screenshot. The window object, and document, will be available within the useEffect. Again, only within the useEffect, because it runs only on the browser. Same with local storage, but once again, only inside the useEffect.

Maybe a library you use, used window without guards?

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@ahmerarain
Comment options

@icyJoseph
Comment options

@ahmerarain
Comment options

@icyJoseph
Comment options

Answer selected by ahmerarain
@icyJoseph
Comment options

@ahmerarain
Comment options

@ahmerarain
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants