Closed jbruxelle closed 6 months ago
Hi @jbruxelle , do you mind sharing your full tsconfig? Also what's your framework that you're trpc with?
I am using nestjs@10.3.4 and here is my tsconfig :
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist",
"module": "commonjs",
"moduleResolution": "node",
"target": "ES6",
"skipLibCheck": true,
"declaration": true,
"emitDeclarationOnly": false,
"removeComments": true,
"noUnusedParameters": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"typeRoots": ["node_modules/@types", "types"],
"paths": {
"@modules/*": ["./src/modules/*"],
"@shared/*": ["./src/shared/*"],
"@gen/*": ["./src/_gen/*"]
}
}
}
Yes, I think changing it to import * as $Schema
will improve compatibility. Will make a fix soon. Also please let me know if you're interested in making a PR. It'll be greatly appreciated! @jbruxelle
Hi !
Issue with @zenstackhq/trpc : ^1.11.1
Module ... has no default export.
import $Schema from ...
Code ref. : https://github.com/zenstackhq/zenstack/blob/ac60a6ad6ac7dbce707d9ba1ba8e664e5fda94dd/packages/plugins/trpc/src/helpers.ts#L241
Possible fix :
sourceFile.addStatements(`import * as $Schema from '${zodSchemasImport}/input';`);
FYI: Yes, I do have
allowSyntheticDefaultImports
andesModuleInterop
totrue
in tsconfig !