Skip to content

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented Sep 8, 2025

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

this uses the new module dependencies feature in https://github.com/nuxt/nuxt/releases/tag/v4.1.0 to specify options for other modules (and require them).

Schema + kit are pinned because this repo is using shamefully-hoist, and the wrong version of each of these might be hoisted.

(We ultimately need to resolve that issue, but it's for another time.)

I'm opening this as a draft because it's very possible that something might break.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@github-actions github-actions bot added the v4 #4488 label Sep 8, 2025
@benjamincanac
Copy link
Member

@danielroe
Copy link
Member Author

danielroe commented Sep 8, 2025

oh, quite right. I'll update this PR once 4.1.2 is out.

@benjamincanac benjamincanac changed the title perf: use module dependencies to manipulate options perf(module): use moduleDependencies to manipulate options Sep 9, 2025
@benjamincanac benjamincanac force-pushed the v4 branch 2 times, most recently from 3f0c24a to c9ba808 Compare September 23, 2025 11:06
Comment on lines +128 to +130
defaults: {
weights: [400, 500, 600, 700]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defaults: {
weights: [400, 500, 600, 700]
}
weights: [400, 500, 600, 700]

The @nuxt/fonts module configuration has an extra nested defaults property that shouldn't be there, which will cause the module to receive incorrect configuration.

View Details

Analysis

Extra nested defaults property in @nuxt/fonts moduleDependencies configuration

What fails: The @nuxt/fonts module configuration in src/module.ts line 123 has an unnecessary nested defaults property: defaults: { defaults: { weights: [...] } } instead of the correct defaults: { weights: [...] }

How to reproduce:

# Both configurations work, but the nested one is incorrect:
git log --oneline -p -S "defaults: {" -- src/module.ts
# Shows migration from registerModule to moduleDependencies introduced extra nesting

Result: The configuration works due to @nuxt/fonts being robust, but contains unnecessary nesting introduced during migration from registerModule('@nuxt/fonts', 'fonts', { defaults: { weights: [...] } }) to moduleDependencies structure

Expected: Should use single-level defaults consistent with other modules like @nuxt/icon and @nuxtjs/color-mode in the same configuration block, per Nuxt Kit moduleDependencies docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants