K
Kinde•4w ago
Filipp Trigub

KindeProvider in react version 5.0.x cannot be imported

When importing, I get Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check your code at App.js:300. with import code: import { KindeProvider } from '@kinde-oss/kinde-auth-react'; It works with 4.0.5, but there is no documentation for that. What am I doing wrong?
10 Replies
Filipp Trigub
Filipp TrigubOP•4w ago
if importing without brackets, I get the error InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/index.43615216af800a7a2c4e.cjs') is not a valid name.
Patrick Cahulao
Patrick Cahulao•4w ago
It seems like the issue might be due to incorrect React version or package installation. Please make sure you're using React version 18 or higher, as this SDK is optimized for those versions. Also, try reinstalling the package with one of these commands:
npm install @kinde-oss/kinde-auth-react
npm install @kinde-oss/kinde-auth-react
yarn add @kinde-oss/kinde-auth-react
yarn add @kinde-oss/kinde-auth-react
pnpm add @kinde-oss/kinde-auth-react
pnpm add @kinde-oss/kinde-auth-react
If you're still facing issues, consider checking your build system or package manager, as there might be compatibility issues with Create React App. Using Vite could be a good alternative. If needed, use default export as a workaround. Let me know if you need further assistance.
Filipp Trigub
Filipp TrigubOP•4w ago
Hi, I am using react 18.3.1. I have retried the installation in various forms, but it does not work. This is not a build issue as I am encountering it before building. This looks to me like an incorrect dependency specification for kinda react. Would you have the documentation for kinde reat 4.0.5?
Daniel_Kinde
Daniel_Kinde•4w ago
Hi, I have been trying to reproduce this issue and have not been able to. Could you share a minimal reproduction repo? Keen to understand what is happening here. @Filipp Trigub , could I ask if you're using a create-react-app react app?
Filipp Trigub
Filipp TrigubOP•4w ago
@Daniel_Kinde yes, I believe so (I was not the initial developer on this project) in package.json I can see react-scripts: ^5.0.1
Daniel_Kinde
Daniel_Kinde•4w ago
This is likely the issue, we are looking into resolving this we have something in progress, however this will become a bigger problem for your application as this is no longer supported by react and other packages will start to fail in time.
I would strongly advise ejecting the app and updating to another build system like vite.
Filipp Trigub
Filipp TrigubOP•4w ago
that's fair, thank you
Daniel_Kinde
Daniel_Kinde•4w ago
DEV Community
Migrating from create-react-app to Vite: A Quick and Easy Guide
In recent times, React has shifted its recommendation from using create-react-app (CRA) as the...
Filipp Trigub
Filipp TrigubOP•4w ago
yeah, I just found the same 😄 on it
Daniel_Kinde
Daniel_Kinde•4w ago
This is example repo using our React SDK, although this is on React 19 - https://github.com/kinde-starter-kits/react-starter-kit
GitHub
GitHub - kinde-starter-kits/react-starter-kit: Starter kit for Reac...
Starter kit for React with Kinde. Contribute to kinde-starter-kits/react-starter-kit development by creating an account on GitHub.

Did you find this page helpful?