Skip to content

chore: fix plugin import#6227

Merged
Bekacru merged 1 commit intobetter-auth:canaryfrom
hyoban:11-23-plugin-import
Nov 23, 2025
Merged

chore: fix plugin import#6227
Bekacru merged 1 commit intobetter-auth:canaryfrom
hyoban:11-23-plugin-import

Conversation

@hyoban
Copy link
Copy Markdown
Contributor

@hyoban hyoban commented Nov 23, 2025

The inferred type of 'baseAuthPlugins' cannot be named without a reference to '../../../../node_modules/better-auth/dist/index-SBjk_96V.mjs'. This is likely not portable. A type annotation is necessary.ts(2742)

Summary by cubic

Fixed the two-factor client to import the plugin type from "." instead of "../../plugins/two-factor", resolving the ts(2742) portability error. Also switched additional-fields client type imports to "@better-auth/core" to avoid non-portable inferred types.

Written for commit 4b0021b. Summary will update automatically on new commits.

Copilot AI review requested due to automatic review settings November 23, 2025 03:17
@vercel
Copy link
Copy Markdown

vercel bot commented Nov 23, 2025

@hyoban is attempting to deploy a commit to the better-auth Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Nov 23, 2025

Open in StackBlitz

better-auth

npm i https://pkg.pr.new/better-auth/better-auth@6227

@better-auth/cli

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/cli@6227

@better-auth/core

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/core@6227

@better-auth/expo

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/expo@6227

@better-auth/passkey

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/passkey@6227

@better-auth/scim

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/scim@6227

@better-auth/sso

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/sso@6227

@better-auth/stripe

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/stripe@6227

@better-auth/telemetry

npm i https://pkg.pr.new/better-auth/better-auth/@better-auth/telemetry@6227

commit: 4b0021b

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a TypeScript type inference error (TS2742) in the two-factor authentication plugin's client file by updating the import path to follow the established codebase convention. The error occurred because TypeScript couldn't create a portable type reference through the complex import path.

  • Simplified the import path from "../../plugins/two-factor" to "." for the twoFactor type import
  • This aligns with the pattern used consistently across all other plugin client files in the codebase
  • Resolves the TypeScript TS2742 error about non-portable type inference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@hyoban hyoban changed the title chore(two-factor): fix plugin import chore: fix plugin import Nov 23, 2025
@hyoban hyoban force-pushed the 11-23-plugin-import branch from 65b1d6d to 4b0021b Compare November 23, 2025 03:40
@Bekacru Bekacru merged commit b9b3787 into better-auth:canary Nov 23, 2025
8 of 11 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

✅ Successfully cherry-picked to main branch!

himself65 pushed a commit that referenced this pull request Nov 23, 2025
@jslno
Copy link
Copy Markdown
Contributor

jslno commented Nov 23, 2025

@Bekacru This error is still ocurring just with a different named file. We need to export the necessary types to make them accessible to the consumer

The inferred type of 'clientOptions' cannot be named without a reference to '../../node_modules/better-auth/dist/index-DXMBWrNT.mjs'. This is likely not portable. A type annotation is necessary. (ts 2742)

This is also occurs for some other client plugins
See #6230

@better-auth better-auth locked as resolved and limited conversation to collaborators Apr 1, 2026
@bytaesu bytaesu added the locked Locked conversations after being closed for 7 days label Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked Locked conversations after being closed for 7 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants