Skip to content

Cannot redefine property: Symbol(@feathersjs/schema/dispatch) #3476

Closed

Description

@GodBleak

I've encountered an issue where resolveExternal will throw Cannot redefine property: Symbol(@feathersjs/schema/dispatch). However, I can't reproduce this reliably. Sometimes the guard introduced with #3380 catches it, other times it passes the guard and the property is defined by runResolvers, then setDispatch attempts to redefine it. I don't know what influences the different behaviour, as I'll get either result, seemingly at random, rerunning the server without changes. The resolver is just as it was generated:

export const messageExternalResolver = resolve<Message, HookContext<MessageService>>({})

Along with the around hooks:

around: {
  all: [authenticate('jwt'), schemaHooks.resolveExternal(messageExternalResolver), schemaHooks.resolveResult(messageResolver)]
}

I think the guard might need to be moved to immediately before setDispatch, or perhaps a second guard could be added.

System configuration

Module versions:
@feathers/feathers:5.0.24, @feathers/schema:5.0.23

NodeJS version:
NodeJS v18.12.1 with tsx v4.7.1

Operating System:
Manjaro Linux

Module Loader:
ESM

Activity

  1. akasakariko commented on Sep 14, 2026

    @akasakariko
    Contributor

    Opened #3705 with a fix for this error. resolveExternal now rechecks dispatch data after awaiting resolution, so nested or concurrent service calls can reuse an existing dispatch value instead of redefining its non-configurable property.

    The PR includes five service-level regression tests covering nested calls, repeated result objects, and concurrent calls sharing result containers. All five reproduce the TypeError before the fix; the schema workspace's full test command passes all 42 tests with the change.

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