Skip to content

TypeError: The "path" argument must be of type string. Received undefined at server startup with @react-router/serve #14303

@Mehraj-Ali-khan

Description

@Mehraj-Ali-khan

Reproduction

Hi team,

I'm encountering a persistent error when starting my production server with @react-router/serve:

TypeError: The "path" argument must be of type string. Received undefined
at Object.join (node:path:1300:7)
at run (...@React-router\serve\dist\cli.js:95:36)
at processTicksAndRejections (node:internal/process/task_queues:105:5)

DEBUG ENV: {
NODE_ENV: 'production',
DATABASE_URL: '...',
CORS_ORIGINS: 'http://localhost:3000,http://127.0.0.1:3000',
NEXT_PUBLIC_CREATE_BASE_URL: 'https://your-base-url.com',
NEXT_PUBLIC_CREATE_HOST: 'localhost',
NEXT_PUBLIC_PROJECT_GROUP_ID: 'local-dev'
}
DEBUG process.cwd(): C:\Users\BGVEN34763\Downloads\Project\createxyz-project_\apps\web

Dependencies:
"@react-router/serve": "7.5.0",
"@react-router/node": "7.5.0",
"@react-router/fs-routes": "7.5.0",
"@react-router/dev": "7.5.0",
"react-router": "7.5.0",
"react-router-hono-server": "2.12.0"

What I've tried:

Aligned all package versions and used --legacy-peer-deps
Set all required environment variables
Tried both latest and older versions of all related packages
No custom serveStaticOptions or config is being passed
The error persists even with a minimal config

Steps to reproduce:

Build the project: npm run build
Start the server: npm start
Observe the error above

Request:
Is there a missing config or a known bug? What is expected at cli.js:95?

System Info

OS: Windows
Node: v24.4.1
npm :-11.5.2
All @react-router/* and react-router-hono-server packages are aligned (see below)
All required environment variables are set (see debug output below)

Used Package Manager

npm

Expected Behavior

DEBUG ENV: {
NODE_ENV: 'production',
DATABASE_URL: '...',
CORS_ORIGINS: 'http://localhost:3000,http://127.0.0.1:3000',
NEXT_PUBLIC_CREATE_BASE_URL: 'https://your-base-url.com',
NEXT_PUBLIC_CREATE_HOST: 'localhost',
NEXT_PUBLIC_PROJECT_GROUP_ID: 'local-dev'
}
DEBUG process.cwd(): C:\Users\BGVEN34763\Downloads\Project\createxyz-project_\apps\web

Actual Behavior

TypeError: The "path" argument must be of type string. Received undefined
at Object.join (node:path:1300:7)
at run (...@React-router\serve\dist\cli.js:95:36)
at processTicksAndRejections (node:internal/process/task_queues:105:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions