#nitro v3 is not working for me
17 messages ยท Page 1 of 1 (latest)
Lolz I had one too ๐
getting this error when calling better auth.
import { getRequestHeaders } from "@tanstack/react-start/server";
export const getAuthSession = createIsomorphicFn()
.server(() => {
const headers = getRequestHeaders();
console.log(headers);
// const session = await auth.api.getSession({
// headers,
// });
// console.log(session);
// if (!session?.session) {
// return null;
// }
return {
user: "user",
// session: session?.session,
// email: session?.user?.email,
};
})
.client(() => {
// const { data: userSession } = await authClient.getSession();
// if (!userSession) {
// return null;
// }
return {
user: "user",
// session: userSession?.session,
// email: userSession?.user?.email,
};
});
can you both please post in https://discord.com/channels/719702312431386674/1431621556718534798
please provide a complete example project
also please try using nitro nightly, not nitrov3 alpha
use this in your package.json
"nitro": "npm:nitro-nightly@latest",
Using alpha didn't fix it.
I have sooo many different weird errors..
No server actions all commented out..
VITE v7.1.10 ready in 587 ms
โ Local: http://localhost:3001/
โ Network: use --host to expose
โ press h + enter to show help
node:internal/url:826
href = bindingUrl.parse(input, base, true);
^
TypeError: Invalid URL
at new URL (node:internal/url:826:25)
at fetchAddress (file:///Users/franciszekstodulski/Dev/@others/wizytka/apps/admin/node_modules/nitro/dist/_chunks/app.mjs:775:11)
at NodeDevWorker.fetch (file:///Users/franciszekstodulski/Dev/@others/wizytka/apps/admin/node_modules/nitro/dist/_chunks/app.mjs:845:12)
at FetchableDevEnvironment.dispatchFetch (file:///Users/franciszekstodulski/Dev/@others/wizytka/apps/admin/node_modules/nitro/dist/_chunks/plugin.mjs:329:27)
at nitroDevMiddleware (file:///Users/franciszekstodulski/Dev/@others/wizytka/apps/admin/node_modules/nitro/dist/_chunks/plugin.mjs:437:35) {
code: 'ERR_INVALID_URL',
input: '[object Request]'
}
Node.js v24.4.1
error: script "dev" exited with code 1
can you share your full project?
Hey guys ๐ I am here to look for any issues re TSS and Nitro v3. Sharing your projects would be really helpful to investigate issues.
I have on the other side
Removed nitro and used srvx to serve my production code - it's amazing how many hours I spend to trying figure it out ๐ฎ
How did you use srvx? As a plugin or directly?
@naive mantle helped me here ๐
pnpx srvx --prod -s ../client dist/server/server.js
kudos for him ๐
Let me try
My frist try I got some errors too, after switchin back to nitro V2 then still got issues, @naive mantle posted that you need have only one Nitro version on your app or got some conflicts, after cleanup and setted Nitro V2 the appp works perfect!