-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
Description
Description
Issue
When using with only clientId and baseUrl, the app crashes with the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'theme') at AsgardeoProvider (@asgardeo_react.js:21096:52)
Code That Causes the Error
<AsgardeoProvider
clientId={import.meta.env.VITE_CLIENT_ID}
baseUrl={import.meta.env.VITE_BASE_URL}
>
<App />
</AsgardeoProvider>Workaround
The error goes away if I explicitly pass a preferences object with theme, even if it’s empty:
<AsgardeoProvider
clientId={import.meta.env.VITE_CLIENT_ID}
baseUrl={import.meta.env.VITE_BASE_URL}
preferences={{
theme: {},
}}
>
<App />
</AsgardeoProvider>Steps to Reproduce
- Create a React + Vite project.
- Install and import @asgardeo/react.
- Wrap your app in with only clientId and baseUrl.
- Run the app → it crashes with Cannot read properties of undefined (reading 'theme').
Please select the area the issue is related to
@asgardeo/react
Version
0.5.25
Environment Details (with versions)
Package: @asgardeo/react
Environment:
• React + Vite
node version : v23.11.0
• Local dev (localhost:3000)
• Using @asgardeo/react latest version
Reporter Checklist
- I have searched the existing issues and this is not a duplicate.
- I have provided all the necessary information.
- I have tested the issue on the latest version of the package.