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
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.
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:
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.
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?
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?@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
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.
I would strongly advise ejecting the app and updating to another build system like vite.
that's fair, thank you
found a quick guide here: https://dev.to/henriquejensen/migrating-from-create-react-app-to-vite-a-quick-and-easy-guide-5e72
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...
yeah, I just found the same 😄
on it
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.