-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Labels
Description
I'm using React Router as a...
framework
Reproduction
I prepared a repo where this error happened, more precisely this line throws an error
System Info
window is not defined
at eval (/Users/zdunecki/Code/zdunecki/bolt.diy/my-react-router-app/app/routes/home.tsx:9:13)
at instantiateModule (file:///Users/zdunecki/Code/zdunecki/bolt.diy/my-react-router-app/node_modules/vite/dist/node/chunks/dep-CHZK6zbr.js:52974:5Used Package Manager
pnpm
Expected Behavior
I want to expect that in client-side mode I would be able to use window object outside of the render function. Some libraries do use window related objects outside of the render and after importing such as libraries rr7 throws an error.
I dit not tested library version of rr7 but as the framework is more powerful and there's a client-side version it would be awesome to support window object.
Actual Behavior
When I do window outside of render and use ssr:false rr7 throws an error.