Neon Auth Beta error
Hello ! I was trying to use the new feature in beta of authentication.
But i encounter this error : @stackframe_react.js?v=0c522630:11608 Uncaught TypeError: import_react3.default.use is not a function.
If anyone can help me π
Here is my components : My npm ls react output:
Here is my components : My npm ls react output:
5 Replies
eastern-cyanOPβ’3w ago
My component :
import { StackHandler, StackProvider, StackTheme } from '@stackframe/react';
import { Suspense } from 'react';
import { BrowserRouter, Route, Routes, useLocation } from 'react-router-dom';
import { stackClientApp } from '../src/stack/client';
function HandlerRoutes() {
const location = useLocation();
return (
<StackHandler app={stackClientApp} location={location.pathname} fullPage />
);
}
export default function Neon() {
return (
<Suspense fallback={null}>
<BrowserRouter>
<StackProvider app={stackClientApp}>
<StackTheme>
<Routes>
<Route path="/handler/*" element={<HandlerRoutes />} />
<Route path="/" element={<div>hello world</div>} />
</Routes>
</StackTheme>
</StackProvider>
</BrowserRouter>
</Suspense>
);
}
genetic-orangeβ’3w ago
Looks like Stack is trying to use the new
.use()
React hook from React 19. Are you running React 18?eastern-cyanOPβ’3w ago
Yes I am. I should upgrade to 19 ?
genetic-orangeβ’3w ago
You could either upgrade your React version to 19, or downgrade your StackAuth to a React 18 compatible version
eastern-cyanOPβ’3w ago
Thanks a lot π