cli icon indicating copy to clipboard operation
cli copied to clipboard

Changes to devServer settings from a nuxt module are not applied

Open UnQu1et opened this issue 8 months ago • 3 comments

Environment


  • Operating System: Mac OS 15.5
  • Node Version: v22.13.1
  • Nuxt Version: 3.17.4
  • CLI Version: 3.25.1
  • Nitro Version: 2.11.12
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

But also reproducible on latest Nuxt with a new repo.

Reproduction

https://stackblitz.com/edit/nuxt-starter-of6hmhf6?file=modules%2Fmodify-dev-server.ts

In this example, we have a nuxt module that changes the devServer settings in the setup function.

Expected outcome

We expect devServer to be configured with host 1.2.3.4, port 4000, and https enabled.

Actual outcome

Changes to devServer settings from the nuxt module are not respected at all.

Describe the bug

Hi!👋

We are the platform team. We provide our users with modules to enable one of the authorization types used within our company. One of these modules requires modifying devServer settings for local development. Since these changes from the module are not being applied, we are forced to make these changes directly in the nuxt.config.ts file within our users' projects.

We have also tried using various hooks provided by Nuxt, but all of them execute after the devServer has already started.

UnQu1et avatar Jun 10 '25 15:06 UnQu1et