-
-
Notifications
You must be signed in to change notification settings - Fork 234
Description
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-stackscaffold
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
- Is this a known issue with the current development-mode integration between Alchemy and Miniflare?
- Are there required environment variables or directory structures that would cause an undefined path in
.alchemy/out/.../index.js? - Should I generate a minimal reproduction repo if needed?
Happy to provide any additional logs, environment details, or an isolated reproduction.