Skip to content

NestJS and Expo The inferred type of 'auth' cannot be named without a reference #11

Description

@edw19

The inferred type of 'auth' cannot be named without a reference to '.pnpm/better-call@1.1.5_zod@4.1.13/node_modules/better-call'. This is likely not portable. A type annotation is necessary.ts(2742)

When add the expo plugin ts give me this error, i try disabled error with ts config

"declaration": false,

and the error disappears

but when send my app to deploy i have to next error

ode:internal/modules/cjs/loader:1309
throw new ERR_REQUIRE_ESM(filename, true);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/.pnpm/@better-auth+expo@1.4.7_@better-auth+core@1.4.7_@better-auth+utils@0.3.0_@better-fetch+fetch@ez3g47vwejg7obxg356w363qze/node_modules/@better-auth/expo/dist/index.mjs not supported.
Instead change the require of /app/node_modules/.pnpm/@better-auth+expo@1.4.7
@better-auth+core@1.4.7_@better-auth+utils@0.3.0_@better-fetch+fetch@ez3g47vwejg7obxg356w363qze/node_modules/@better-auth/expo/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
 ELIFECYCLE  Command failed with exit code 1.
node:internal/modules/cjs/loader:1309
throw new ERR_REQUIRE_ESM(filename, true);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/.pnpm/@better-auth+expo@1.4.7
@better-auth+core@1.4.7_@better-auth+utils@0.3.0_@better-fetch+fetch@ez3g47vwejg7obxg356w363qze/node_modules/@better-auth/expo/dist/index.mjs not supported.
Instead change the require of /app/node_modules/.pnpm/@better-auth+expo@1.4.7
@better-auth+core@1.4.7_@better-auth+utils@0.3.0_@better-fetch+fetch@_ez3g47vwejg7obxg356w363qze/node_modules/@better-auth/expo/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at Object. (/app/dist/auth.js:7:16) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v22.11.0

better auto expo has support for nest js modules ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions