The inferred type of 'authClient' cannot be named without a reference to undici-types@7.5.0

Currently having an issue with undici:

The inferred type of 'authClient' cannot be named without a reference to '.pnpm/undici-types@7.5.0/node_modules/undici-types'. This is likely not portable. A type annotation is necessary.


My auth client:

export const authClient = createAuthClient({
  baseURL: 'http://localhost:3000',
  fetchOptions: {
    onError: (ctx) => {
      addToast({
        title: 'Error',
        description: ctx.error.message,
        variant: 'solid',
        color: 'danger',
      });
    },
  },
  plugins: [usernameClient()],
});


My tsconfig:

{
  "extends": "@repo/typescript-config/nextjs.json",
  "compilerOptions": {
    "lib": ["ESNext", "DOM", "DOM.Iterable"],
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": [
    "next-env.d.ts",
    "next.config.ts",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts"
  ],
  "exclude": ["node_modules"]
}
Was this page helpful?