Skip to content

devServer configuration from a layer is only partially applied in 3.16.0 #854

@oskarols

Description

@oskarols

Environment


  • Operating System: Linux
  • Node Version: v20.18.3
  • Nuxt Version: 3.15.1
  • CLI Version: 3.22.5
  • Nitro Version: 2.11.6
  • Package Manager: yarn@4.7.0
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

But also reproducible on latest Nuxt with a new repo.

Reproduction

https://stackblitz.com/edit/github-6s8wmezq?file=nuxt.config.ts

In this example we're using a layer to set the devServer configuration to port 4000 and host 1.2.3.4.

Expected outcome

I would expect the devServer to be configured with host 1.2.3.4 and port 4000.

There should be an error with Unable to find a random port on host "1.2.3.4".

Actual outcome

The devServer is configured with port 4000, but the host configuration is not used at all.

Describe the bug

Hi 👋

We are using a Nuxt monorepo. In that monorepo we had a layer to configure the dev server, which we reused in multiple applications.

We recently upgraded from Nuxt 3.10.3 to 3.15.1. After this hot-module-reloading stopped working, due to errors with establishing the WebSocket connection.
I tracked the reason for this down to the devServer configuration from this previously mentioned layer. It seems this is now only partially being applied to the Nuxt dev server, and comparing the configuration being set when using a layer and when using the application nuxt.config.ts file directly it's noticably different when setting breakpoints inside the dev server script.

The temporary fix for us was to move the devServer config to the immediate nuxt.config.ts file for each application. We would love to be able to use a shared configuration for this again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions