Closed Qrokqt closed 4 months ago
@Qrokqt Hi!
Is TSchema the wrong type to use or any other idea why its not working?
The code you have there looks correct. However, I'm not a familiar with pnpm, so can't provide must assistance there. Some things you can try though.
1) Ensure all projects are configured as strict
(tsconfig.json)
2) Ensure all projects are configured as either module: CommonJS
, or module: NodeNext
(tsconfig.json) (these should be the same across projects in your monorepo as TB provides both ESM and CJS versions which are incompatible with each other)
3) Ensure you only have one version of TypeBox installed.
Give the above a try. If this doesn't solve the issue, if you're able to setup a simple GH reproduction project, I may be able to provide a bit more assistance.
Cheers S
Thanks, in trying to create a repro I found that I had missed "type": "module"
in the shared workspace. Once I added that it stopped throwing the error.
I've got a project setup using pnpm workspaces setup like so
in shared im exporting a schema
and in the server im importing it and trying to use it
but I'm getting the error
Is TSchema the wrong type to use or any other idea why its not working?