We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I encounter this error on build when using useSWRImmutable on a Server-Side Generated page (getStaticProps)
const { data } = useSWRImmutable(key, fetcher)
TypeError: Cannot read property '0' of undefined
This code seems to be the cause:
https://github.com/vercel/swr/blob/master/src/use-swr.ts#L46
const [ EVENT_REVALIDATORS, STATE_UPDATERS, MUTATION_TS, MUTATION_END_TS, CONCURRENT_PROMISES, CONCURRENT_PROMISES_TS ] = SWRGlobalState.get(cache) as GlobalState
SWRGlobalState.get(cache) seems to be undefined in this case
SWRGlobalState.get(cache)
[email protected]
The text was updated successfully, but these errors were encountered:
@hazae41 Thanks for reporting and using the beta version of swr 🙏
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug report
Description / Observed Behavior
I encounter this error on build when using useSWRImmutable on a Server-Side Generated page (getStaticProps)
This code seems to be the cause:
https://github.com/vercel/swr/blob/master/src/use-swr.ts#L46
SWRGlobalState.get(cache)
seems to be undefined in this caseAdditional Context
[email protected]
The text was updated successfully, but these errors were encountered: