Prerequisites
Fastify version
5.3.3
Plugin version
5.1.0
Node.js version
22
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Darwin 24.5.0
Description
Hi there!
First of all, thanks for the plugin.
I am encountering an error when I'm trying to move out my schema definitions outside of my route plugin. I wanted to move them out to be able to share them in other route plugins but I'm getting this error:
Unable to dereference schema with $id ...
This also happens even when you use fastify-plugin to wrap the plugin that defines the shared schemas.
Link to code that reproduces the bug
https://github.com/FerrielMelarpis/fastify-typebox-issue-repro
Expected Behavior
I should be able to define the shared schemas outside of my route plugins and reference them via Type.Ref.
Prerequisites
Fastify version
5.3.3
Plugin version
5.1.0
Node.js version
22
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Darwin 24.5.0
Description
Hi there!
First of all, thanks for the plugin.
I am encountering an error when I'm trying to move out my schema definitions outside of my route plugin. I wanted to move them out to be able to share them in other route plugins but I'm getting this error:
This also happens even when you use
fastify-pluginto wrap the plugin that defines the shared schemas.Link to code that reproduces the bug
https://github.com/FerrielMelarpis/fastify-typebox-issue-repro
Expected Behavior
I should be able to define the shared schemas outside of my route plugins and reference them via
Type.Ref.