[X] I have searched existing issues to ensure the issue has not already been raised
Issue
ReferenceError: Cannot access 'User' before initialization
at Object.User (/home/kowu/workspace/fastify-mongo/src/app/users/schema.ts:1:1)
at Object.get [as User] (/home/kowu/workspace/fastify-mongo/src/app/users/schema.ts:2:570)
at S (/home/kowu/workspace/fastify-mongo/src/app/posts/schema.ts:15:46)
at Object.<anonymous> (/home/kowu/workspace/fastify-mongo/src/app/posts/schema.ts:46:1)
at Module._compile (node:internal/modules/cjs/loader:1255:14)
at Object.y (/home/kowu/workspace/fastify-mongo/node_modules/.pnpm/tsx@4.3.0/node_modules/tsx/dist/cjs/index.cjs:1:1151)
at Module.load (node:internal/modules/cjs/loader:1113:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1137:19)
at require (node:internal/modules/helpers:121:18)
Node.js v20.3.0
Prerequisites
Issue
I have two schema, User and Post. Importing Post schema in User schema causes error. Any idea? repo: https://github.com/zfadhli/fastify-mongo