Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Not able to expose Nuxt 4.2.0 project using --host #1118

@ShreyasAch

Description

@ShreyasAch

Bug Report

Nuxt version(s) tested: 4.1.3, 4.2.0
Node version: (v24.0.0)
Package manager: (npm)
Operating system: (Linux)

I’m encountering the following error when running the Nuxt dev server with the --host flag:

ERROR The "hostname" argument must be of type string. Received type boolean (true)

This happens in both Nuxt 4.1.3 and Nuxt 4.2.0, even though the same configuration used to work correctly before.

In package.json:

"scripts": {
"dev": "nuxt dev -p 3000 --host"
}

Running:
npm run dev

Previously, this command exposed the Nuxt app on all network interfaces, which was useful for deployment or testing on linked servers.

Now, it fails with the error above.

The error originates from the get-port-please package, which is a dependency of @nuxt/devtools.

### Steps to Reproduce

Create or open any Nuxt 4.1.3 or 4.2.0 project.

Add the following dev script in package.json:

"dev": "nuxt dev -p 3000 --host"

Run:
npm run dev

You’ll see:

ERROR The "hostname" argument must be of type string. Received type boolean (true)

Any insights on this issue? Also, what’s the best practice to achieve the same behavior as --host previously provided?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions