React Version mismatch found during local development

Open
#519 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
react, typescript

Research direction

Reproduce the crash with the Vite setup using the shown main.tsx and App.tsx files, focusing on the @asgardeo/react UserDropdown component after login. Compare the React versions involved in the app and SDK, then verify that the authenticated app renders UserDropdown without crashing.

Written by the indexing model from the issue text.

Description

Type/Bug
Description

When building a Vite app with React, the app crashes after Login
Image

Steps to Reproduce

Create a Vite App, use the Asgardeo SDK.

Codes used
main.tsx

import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.jsx'
import { AsgardeoProvider } from '@asgardeo/react'

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <AsgardeoProvider
      baseUrl="https://localhost:8090"
      signInUrl="http://localhost:5173/signin"
      applicationId="019e2459-5462-7f91-8f39-3d355d1a6359"
      platform="AsgardeoV2"
    >
      <App />
    </AsgardeoProvider>
  </StrictMode>
)

App.tsx

import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import { SignIn, SignedIn, SignedOut, SignInButton, SignOutButton, UserDropdown } from '@asgardeo/react'
import './App.css'

function App() {
  return (
    <Router>
      <header>
        <SignedIn>
          <UserDropdown />
          <SignOutButton />
        </SignedIn>
        <SignedOut>
          <SignInButton />
        </SignedOut>
      </header>
      <Routes>
        <Route path="/signin" element={<SignIn />} />
      </Routes>
    </Router>
  )
}

export default App

The issue hints to something internal to the <UserDropdown /> component

Please select the area the issue is related to

@asgardeo/express, @asgardeo/react

Version

22ee26dd5728c6a2f003d7aa5702ba088c044ad4

Environment Details (with versions)

Create a Vite App, and setup the thunder-id/thunder repository instructions.

Note that this is not related to thunder, by any means and is a react version mismatch, found during local development.

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.
Dominant language
TypeScript
Stars
18
Forks
67
Avg merge
4h 6m
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from asgardeo/javascript

All issues in asgardeo/javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.