Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GodBleak opened this issue Apr 27, 2024 · 0 comments
Open

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

GodBleak opened this issue Apr 27, 2024 · 0 comments

Comments

@GodBleak
Copy link

GodBleak commented Apr 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant