Skip to content

Incorrect order of modules: modules from project root are loaded before the ones in layer #25719

@adamcikado

Description

@adamcikado

Environment

  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.10.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@10.2.3
  • Builder: -
  • User Config: extends, modules
  • Runtime Modules: ()
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-vg4ayj

You can see in the console that the module from the root folder is loaded first.

Describe the bug

I'd expect modules from any layers to be loaded before the ones in project root.

Additional context

This issue seems to be in defu when merging arrays in config object here https://github.com/unjs/defu/blob/main/src/defu.ts#L33

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions