You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ReferenceError: window is not defined
at Object.singleFetchUrl (/home/projects/remix-run-remix-rv7ocwf6/node_modules/@remix-run/react/dist/single-fetch.js:324:58)
at eval (/home/projects/remix-run-remix-rv7ocwf6/node_modules/@remix-run/react/dist/components.js:362:27)
at Object.useMemo (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react-dom/cjs/react-dom-server.node.development.js:5190:19)
at Object.useMemo (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react/cjs/react.development.js:1650:21)
at PrefetchPageLinksImpl (/home/projects/remix-run-remix-rv7ocwf6/node_modules/@remix-run/react/dist/components.js:332:36)
at renderWithHooks (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react-dom/cjs/react-dom-server.node.development.js:5724:16)
at renderIndeterminateComponent (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react-dom/cjs/react-dom-server.node.development.js:5798:15)
at renderElement (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react-dom/cjs/react-dom-server.node.development.js:6023:7)
at renderNodeDestructiveImpl (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react-dom/cjs/react-dom-server.node.development.js:6181:11)
at renderNodeDestructive (/home/projects/remix-run-remix-rv7ocwf6/node_modules/react-dom/cjs/react-dom-server.node.development.js:6153:14)
The text was updated successfully, but these errors were encountered:
anhdd-kuro
changed the title
Using data function in single fetch with PrefetchPageLink cause "window is not defined"
PrefetchPageLink to route that using data function in single fetch with cause "window is not defined"
Feb 11, 2025
anhdd-kuro
changed the title
PrefetchPageLink to route that using data function in single fetch with cause "window is not defined"
PrefetchPageLink to route that return deferredData in single fetch mode cause "window is not defined"
Feb 11, 2025
anhdd-kuro
changed the title
PrefetchPageLink to route that return deferredData in single fetch mode cause "window is not defined"
PrefetchPageLink in single fetch mode cause "window is not defined"
Feb 11, 2025
A temporary solution is to set v3_singleFetch: false, in vite.config.
Alternatively, you could remove loader from “foo.tsx” and replace it with your client logic
The reason for this problem is that you are using client logic in the line "
", so it seems that this error occurs in SSR environments. I don't know if it's possible to fix it like below, but I think the "remix" team should provide a detailed guide
Reproduction
https://stackblitz.com/edit/remix-run-remix-rv7ocwf6
System Info
Used Package Manager
pnpm
Expected Behavior
Should render prefetch link normally
Actual Behavior
Causing window is not defined error
The text was updated successfully, but these errors were encountered: