#nitro v3 is not working for me

17 messages ยท Page 1 of 1 (latest)

lethal oar
#

I can build but when i run the app i get errors

Listening on http://[::]:3000
TypeError: r.split is not a function

switching back to nitri v2 and everything works again.

jagged zodiac
#

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,
    };
  });
naive mantle
#

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",

jagged zodiac
#

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
naive mantle
#

can you share your full project?

strange hill
#

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.

jagged zodiac
#

Removed nitro and used srvx to serve my production code - it's amazing how many hours I spend to trying figure it out ๐Ÿ˜ฎ

lethal oar
jagged zodiac
#

@naive mantle helped me here ๐Ÿ˜„
pnpx srvx --prod -s ../client dist/server/server.js
kudos for him ๐Ÿ™‚

lethal oar
#

Let me try

wanton dragon
#

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!