Import error #207

Closed
opened 2026-03-13 07:37:39 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @emroot on GitHub (Nov 10, 2024).

Describe the bug
I'm starting my migration from next-auth to better-auth on nextjs. I keep getting this error after my install.

@ambrosia/api:dev:  ○ Compiling /api/auth/[...all] ...
@ambrosia/api:dev:  ⨯ ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
@ambrosia/api:dev: Attempted import error: 'g' is not exported from '../shared/consola.36c0034f.mjs' (imported as 'getDefaultExportFromCjs').
@ambrosia/api:dev:
@ambrosia/api:dev: Import trace for requested module:
@ambrosia/api:dev: ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
@ambrosia/api:dev: ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs
@ambrosia/api:dev: ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/index.mjs
@ambrosia/api:dev: ../../node_modules/.pnpm/better-auth@0.8.2-beta.1/node_modules/better-auth/dist/index.js
@ambrosia/api:dev: ./lib/betterAuth.ts
@ambrosia/api:dev: ./app/api/auth/[...all]/route.ts

Additional context

  • nextjs "^14.1.4"

My next.config.js

const nextConfig = withTM({
  reactStrictMode: false,
  swcMinify: true,
  experimental: {
    externalDir: true,
    esmExternals: 'loose',
  },
})
Originally created by @emroot on GitHub (Nov 10, 2024). **Describe the bug** I'm starting my migration from next-auth to better-auth on nextjs. I keep getting this error after my install. ``` @ambrosia/api:dev: ○ Compiling /api/auth/[...all] ... @ambrosia/api:dev: ⨯ ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs @ambrosia/api:dev: Attempted import error: 'g' is not exported from '../shared/consola.36c0034f.mjs' (imported as 'getDefaultExportFromCjs'). @ambrosia/api:dev: @ambrosia/api:dev: Import trace for requested module: @ambrosia/api:dev: ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs @ambrosia/api:dev: ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/shared/consola.36c0034f.mjs @ambrosia/api:dev: ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/index.mjs @ambrosia/api:dev: ../../node_modules/.pnpm/better-auth@0.8.2-beta.1/node_modules/better-auth/dist/index.js @ambrosia/api:dev: ./lib/betterAuth.ts @ambrosia/api:dev: ./app/api/auth/[...all]/route.ts ``` **Additional context** - nextjs "^14.1.4" My next.config.js ``` const nextConfig = withTM({ reactStrictMode: false, swcMinify: true, experimental: { externalDir: true, esmExternals: 'loose', }, }) ```
Author
Owner

@emroot commented on GitHub (Nov 10, 2024):

nvm looks like my .babelrc was messing up with this.

@emroot commented on GitHub (Nov 10, 2024): nvm looks like my .babelrc was messing up with this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#207