GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Options propagation · Issue #841 · fastify/fastify-cli

Options propagation #841

New issue
Copy link
New issue
Copy link
Open
Open
Options propagation#841
Copy link

Description

@jean-michelet
jean-michelet
opened on Sep 19, 2025
Issue body actions

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

By default, the generated templates pass options to the autoloader, which are then propagated to all loaded plugins.
This behavior can cause errors with external plugins if they receive unexpected properties or values in options

Here’s an example of the issue in the demo repository:
fastify/demo#119

Should we continue to do this?
Or simply add doc to prevent this kind of errors in the future?

Activity

  1. sinbumu commented on Nov 16, 2026

    @sinbumu
    sinbumu
    on Nov 16, 2026
    More actions

    I'd like to propose a documentation-first approach that preserves the current defaults.

    An AI-assisted investigation using the current CJS template (main at 1fb1f49, CLI package 8.0.3) reproduced an option collision: server-level ajv.customOptions.coerceTypes: false reached an autoloaded @fastify/env plugin, so PORT: '3000' failed integer validation. This was a template-based minimal reproduction, not a full CLI integration test, using Fastify 5.12.8, autoload 6.5.1, env 5.0.3 and env-schema 6.1.0. The historical ajv.validate is not a function error in demo#119 did not reproduce with these versions.

    Removing all autoload options avoided the collision, but also stopped application-specific options from reaching routes. Passing only selected application options, or wrapping the external plugin and supplying its options explicitly, preserved those values without the collision.

    Would you welcome a small documentation/template-comment change that:

    • explains the server/app/autoload option propagation and possible name collisions;
    • shows selective forwarding or an explicit wrapper for third-party plugins;
    • keeps the existing default behavior for compatibility, with consistent guidance across the templates?

    Or would you prefer changing the default forwarding in newly generated applications? I wanted to check the intended direction before preparing a PR.

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

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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.