How to have access window on next.config.js?
Does someone know how to get access to window variable on next.config.js i will need to read the window.location path. Thanks
4 Replies
Hey @jos3 ,
You cannot access the
window
object from next.config.js
. The window object can only be accessed through the browserextended-salmon•2y ago
Thanks Ömer, will try to find another way.
btw @Omer do you know any other way to access url path on next.config.js with useRouter maybe?
I think this is not possible but you can also ask on Next.js discord server
extended-salmon•2y ago
I've already asked, hopefully someone have an answer, thanks again