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
This error throw when using useSWR with NextJS 13.4.1 and a custom server
- error TypeError: Cannot read properties of null (reading 'useContext')
at useContext (/home/simon/Documents/Git/Airthium/next-swr-issue/node_modules/react/cjs/react.development.js:1618:21)
at useSWRConfig (file:///home/simon/Documents/Git/Airthium/next-swr-issue/node_modules/swr/_internal/dist/index.mjs:580:40)
at useSWRArgs (file:///home/simon/Documents/Git/Airthium/next-swr-issue/node_modules/swr/_internal/dist/index.mjs:614:32)
at useApi (webpack-internal:///./src/api/index.tsx:41:87)
at Home (webpack-internal:///./src/pages/index.tsx:26:67)
Bug report
Description / Observed Behavior
This error throw when using
useSWR
with NextJS 13.4.1 and a custom serverWithout custom server, it works well
Expected Behavior
No error
Repro Steps / Code Example
Repro
Run without custom server:
yarn && yarn dev
, Works wellRun with custom server:
yarn && yarn customserver
, BugAdditional Context
SWR version. 2.1.5
If you uncomment
transpilePackages: ["swr"]
innext.config.js
, all works with the custom server. I do not understand why.No problem with NextJS 13.3.4
The text was updated successfully, but these errors were encountered: