Upgrade v1.4.5 to v1.4.6 - argument 'path' undefined #2492

Closed
opened 2026-03-13 09:58:58 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @jinsley8 on GitHub (Dec 9, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

I'm using better-auth with Hono.js and Cloudflare Worker. After ugrading v.1.4.5 to v1.4.6 i cannot start the server.

I get this error:

 [ERROR] service core:user:worker-api-mobile-dev: Uncaught TypeError: The argument 'path' The argument must be a file URL object, a file URL string, or an absolute path string.. Received 'undefined'

    at null.<anonymous> (node:module:34:15) in createRequire
    at null.<anonymous> (index.js:22452:34) in
  ../../node_modules/better-auth/dist/chunk-DieNfLhd.mjs
    at null.<anonymous> (index.js:15:59) in __init
    at null.<anonymous> (index.js:40685:5) in
  ../../node_modules/better-auth/dist/get-migration-CDvYpogu.mjs
    at null.<anonymous> (index.js:15:59) in __init
    at null.<anonymous> (index.js:55599:5) in ../../node_modules/better-auth/dist/index.mjs
    at null.<anonymous> (index.js:15:59) in __init
    at null.<anonymous> (index.js:76350:5) in ../../packages/auth/src/server/admin-auth.ts
    at null.<anonymous> (index.js:15:59) in __init
    at null.<anonymous> (index.js:90180:5) in ../../packages/auth/src/server/index.ts

Current vs. Expected behavior

Servr should be able to start but issue with better-auth

What version of Better Auth are you using?

1.4.6

System info

{
  "system": {
    "platform": "darwin",
    "arch": "arm64",
    "version": "Darwin Kernel Version 24.6.0: Wed Oct 15 21:12:06 PDT 2025; root:xnu-11417.140.69.703.14~1/RELEASE_ARM64_T6000",
    "release": "24.6.0",
    "cpuCount": 10,
    "cpuModel": "Apple M1 Pro",
    "totalMemory": "32.00 GB",
    "freeMemory": "0.21 GB"
  },
  "node": {
    "version": "v24.1.0",
    "env": "development"
  },
  "packageManager": {
    "name": "npm",
    "version": "11.6.4"
  },
  "frameworks": [
    {
      "name": "react",
      "version": "catalog:react19"
    }
  ],
  "databases": null,
  "betterAuth": {
    "version": "catalog:",
    "config": null
  }
}

Which area(s) are affected? (Select all that apply)

Backend, Package

Auth config (if applicable)


Additional context

No response

Originally created by @jinsley8 on GitHub (Dec 9, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce I'm using better-auth with Hono.js and Cloudflare Worker. After ugrading v.1.4.5 to v1.4.6 i cannot start the server. I get this error: ```js ✘ [ERROR] service core:user:worker-api-mobile-dev: Uncaught TypeError: The argument 'path' The argument must be a file URL object, a file URL string, or an absolute path string.. Received 'undefined' at null.<anonymous> (node:module:34:15) in createRequire at null.<anonymous> (index.js:22452:34) in ../../node_modules/better-auth/dist/chunk-DieNfLhd.mjs at null.<anonymous> (index.js:15:59) in __init at null.<anonymous> (index.js:40685:5) in ../../node_modules/better-auth/dist/get-migration-CDvYpogu.mjs at null.<anonymous> (index.js:15:59) in __init at null.<anonymous> (index.js:55599:5) in ../../node_modules/better-auth/dist/index.mjs at null.<anonymous> (index.js:15:59) in __init at null.<anonymous> (index.js:76350:5) in ../../packages/auth/src/server/admin-auth.ts at null.<anonymous> (index.js:15:59) in __init at null.<anonymous> (index.js:90180:5) in ../../packages/auth/src/server/index.ts ``` ### Current vs. Expected behavior Servr should be able to start but issue with better-auth ### What version of Better Auth are you using? 1.4.6 ### System info ```bash { "system": { "platform": "darwin", "arch": "arm64", "version": "Darwin Kernel Version 24.6.0: Wed Oct 15 21:12:06 PDT 2025; root:xnu-11417.140.69.703.14~1/RELEASE_ARM64_T6000", "release": "24.6.0", "cpuCount": 10, "cpuModel": "Apple M1 Pro", "totalMemory": "32.00 GB", "freeMemory": "0.21 GB" }, "node": { "version": "v24.1.0", "env": "development" }, "packageManager": { "name": "npm", "version": "11.6.4" }, "frameworks": [ { "name": "react", "version": "catalog:react19" } ], "databases": null, "betterAuth": { "version": "catalog:", "config": null } } ``` ### Which area(s) are affected? (Select all that apply) Backend, Package ### Auth config (if applicable) ```typescript ``` ### Additional context _No response_
GiteaMirror added the hono label 2026-03-13 09:58:58 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 9, 2025):

tag @better-auth-agent if you would like an answer from the Agent

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Dec 9, 2025): tag @better-auth-agent if you would like an answer from the Agent _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@dosubot[bot] commented on GitHub (Dec 9, 2025):

This is a regression in better-auth v1.4.6: Node.js-specific code (like createRequire from node:module) is now imported in code paths that run even in environments like Hono.js, where Node primitives such as import.meta.url are undefined. This causes the "argument 'path' undefined" error and prevents your server from starting. The issue is not caused by your configuration or usage, but by changes in how modules are bundled and imported in v1.4.6 [source].

The most reliable workaround is to downgrade to v1.4.5, which does not have this regression [source]. Alternatively, you can try the latest beta (e.g., 1.4.6-beta.4) if available, as it may include a fix. Disabling telemetry or changing import paths will not resolve this server-side error.

Keep an eye out for future releases that address this regression and restore compatibility with Hono.js and other serverless or non-Node environments. If you need help auditing your imports or have a more complex setup, let me know!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 9, 2025): <!-- Answer --> This is a regression in better-auth v1.4.6: Node.js-specific code (like `createRequire` from `node:module`) is now imported in code paths that run even in environments like Hono.js, where Node primitives such as `import.meta.url` are undefined. This causes the "argument 'path' undefined" error and prevents your server from starting. The issue is not caused by your configuration or usage, but by changes in how modules are bundled and imported in v1.4.6 [[source](https://github.com/better-auth/better-auth/issues/6635)]. The most reliable workaround is to downgrade to v1.4.5, which does not have this regression [[source](https://github.com/better-auth/better-auth/issues/6637)]. Alternatively, you can try the latest beta (e.g., `1.4.6-beta.4`) if available, as it may include a fix. Disabling telemetry or changing import paths will not resolve this server-side error. Keep an eye out for future releases that address this regression and restore compatibility with Hono.js and other serverless or non-Node environments. If you need help auditing your imports or have a more complex setup, let me know! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/017a3d06-3f94-417a-8f46-c5aac11d7606?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/cdda13d9-dd27-4d31-b09a-5d8bec92de21/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20regression%20in%20better-auth%20v1.4.6%3A%20Node.js-specific%20code%20%28like%20%60createRequire%60%20from%20%60node%3Amodule%60%29%20is%20now%20imported%20in%20code%20paths%20that%20run%20even%20in%20environments%20like%20Hono.js%2C%20where%20Node%20primitives%20such%20as%20%60import.meta.url%60%20are%20undefined.%20This%20causes%20the%20%22argument%20%27path%27%20undefined%22%20error%20and%20prevents%20your%20server%20from%20starting.%20The%20issue%20is%20not%20caused%20by%20your%20configuration%20or%20usage%2C%20but%20by%20changes%20in%20how%20modules%20are%20bundled%20and%20imported%20in%20v1.4.6%20%5B%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6635%29%5D.%0A%0AThe%20most%20reliable%20workaround%20is%20to%20downgrade%20to%20v1.4.5%2C%20which%20does%20not%20have%20this%20regression%20%5B%5Bsource%5D%28https%3A//github.com/better-auth/better-auth/issues/6637%29%5D.%20Alternatively%2C%20you%20can%20try%20the%20latest%20beta%20%28e.g.%2C%20%601.4.6-beta.4%60%29%20if%20available%2C%20as%20it%20may%20include%20a%20fix.%20Disabling%20telemetry%20or%20changing%20import%20paths%20will%20not%20resolve%20this%20server-side%20error.%0A%0AKeep%20an%20eye%20out%20for%20future%20releases%20that%20address%20this%20regression%20and%20restore%20compatibility%20with%20Hono.js%20and%20other%20serverless%20or%20non-Node%20environments.%20If%20you%20need%20help%20auditing%20your%20imports%20or%20have%20a%20more%20complex%20setup%2C%20let%20me%20know%21)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/better-auth/better-auth/issues/6638)
Author
Owner

@himself65 commented on GitHub (Jan 3, 2026):

This should have been fixed in the latest version. The reason is because of the bundler

@himself65 commented on GitHub (Jan 3, 2026): This should have been fixed in the latest version. The reason is because of the bundler
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2492