Skip to content

Improve errors when using "story as service" and story is not a service #1106

Description

@nikophil

When trying to use DI on a story which is not a service, the following error occur

  1. Exception in third-party event subscriber: Stories with dependencies (Story services) cannot be used without the foundry bundle.

I think the error message could be improved

Activity

  1. tehmaestro commented on Apr 6, 2026

    @tehmaestro

    Hey, I just encountered an issue and was able to figure it out pretty quickly
    #1112

    However, I was thinking if maybe it makes sense to improve the docs and add a warning that starting with Symfony 8 you'll have to add service definitions precisely in the test/dev environments. You should not add a service definition tagged with foundry.story in the base service definitions, as this will throw an exception from now on.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions