Closed nanoqoi closed 2 years ago
Hello @Synqat,
Thanks for reaching out. For the short term, I'd recommend you use our JS-SSR SDK in your application: https://configcat.com/docs/sdk-reference/js-ssr/ It uses axios for fetching the config files: https://github.com/configcat/js-ssr-sdk/blob/master/src/ConfigFetcher.ts This SDK is not a React-specific SDK, it is a generic JS-based SDK. It doesn't have hooks/etc. For the long term, we'll figure out a way to provide a dedicated React SDK for SSR applications. I'm adding it to our backlog. Let me know if this works for you.
Cheers, Lali
Hiya @laliconfigcat,
I'll check this out and see what I can get up to, thank you for the quick response! I look forward to the progress on this repository but happy to make a workaround for now 😄
This issue is marked stale because it has no activity in the last 3 weeks. The issue will be closed in one week. Please remove the stale flag to keep it open.
This issue was closed due to no activity.
Hi! This is my first bug report and is a problem I've been encountering on one of my projects, I hope this is okay and something in scope for this repository. If this is something I should address on my own or figure out with NextJS instead, let me know!
Describe the bug
When trying to use the library in a NextJS environment, the Next SSR throws the following error:
Here's a code repository with the reproducible bug: https://github.com/Synqat/bug-report-nextjs-configcat-react
To reproduce
npx create-next-app@latest
yarn add configcat-react
or equivalent in project directory%app%/pages/_app.js
to include provider from library (with sdkKey defined)yarn dev
in project directory and hard refresh the web pageExpected behavior
The app should be able to fetch when being SSRed by NextJS. Perhaps using the more universal
fetch
method would be suitable?Versions
12.3.1
18.2.0
1.0.1