Skip to content

MiniflareCoreError: Workers runtime failed to start due to invalid 'path' argument during alchemy dev #721

@nitinmogalapalli

Description

@nitinmogalapalli

Summary
Running pnpm dev on a fresh Better T Stack project fails during the server startup phase. The Workers runtime (Miniflare) crashes with a TypeError: The argument 'path' must be a file URL object, a file URL string, or an absolute path string. Received 'undefined'. This prevents the server resource from coming up under alchemy dev.

This appears to originate from createRequire being invoked with an undefined path inside the generated .alchemy/out/.../index.js.


Environment

  • OS: Kali Linux
  • Node.js: v25.2.1
  • pnpm: v10.25.0
  • Alchemy: v0.77.5
  • Next.js: 16.0.10 (Turbopack)
  • Miniflare: 4.20251210.0
  • Project: Fresh create-better-t-stack scaffold

Reproduction Steps

pnpm create better-t-stack@latest my-better-t-app --frontend next native-uniwind --backend hono --runtime workers --api trpc --auth better-auth --payments none --database postgres --orm drizzle --db-setup neon --package-manager pnpm --git --web-deploy alchemy --server-deploy alchemy --install --addons biome husky tauri turborepo --examples none
cd my-better-t-app
pnpm install
pnpm dev

Output excerpt:

service core:user:my-better-t-app-server-kali: 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 node:module:34:15 in createRequire
  at .alchemy/out/my-better-t-app-server-kali/index.js:40713:33

ERROR Scope failed my-better-t-app/kali/server
WARN Scope is in error, skipping finalize
ERROR Scope failed my-better-t-app/kali
Exiting...

MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.

Expected Behavior
pnpm dev should bring up both web and server resources under Alchemy without runtime crashes.


Actual Behavior
The server resource fails during Miniflare startup due to an invalid path passed to createRequire. The process exits and Alchemy goes into a restart-pending state.


Questions for Maintainers

  1. Is this a known issue with the current development-mode integration between Alchemy and Miniflare?
  2. Are there required environment variables or directory structures that would cause an undefined path in .alchemy/out/.../index.js?
  3. Should I generate a minimal reproduction repo if needed?

Happy to provide any additional logs, environment details, or an isolated reproduction.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions