-
Notifications
You must be signed in to change notification settings - Fork 68
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
Type re-exporting problem with Next.js #33
Comments
Hi @dmitryk-sfx , Could you please explain it little bit more? What kind of result are you expecting? Thanks! |
I have a problem that sounds like this -> if a Type references itself an import to itself is added to the Type file. import { ArcImageInfo } from "./ArcImageInfo";
export interface ArcImageInfo {
/** docReference[] */
docReference?: Array<ArcImageInfo>;
} ok - that specific issue seems to have been solved here: #39 |
Sorry for delay. Currently library re-export types from definitions, services, ports and client.ts in index.ts with This was error from TS This is can be fixed with rewriting types exports after client generation, but I think this should be fixed on library side. My short script for rewrite exports: // Temporary solution for types re-export problem for --isolatedModules: true
const indexFile = readFileSync(
`${generatedFolder}/${service.toLowerCase()}/index.ts`,
'utf8'
)
const formattedIndexFile = indexFile
.replace(/export { (?!createClientAsync)/g, 'export type { ')
writeFileSync(
`${generatedFolder}/${service.toLowerCase()}/index.ts`,
formattedIndexFile
) |
I'm not
|
@dmitryk-sfx Do you think this could be solved by simply adding |
Right. |
Any activity on this? Would be great to be able to use this in NextJS, as it requires to have Edit: I'm happy to test any solutions or provide a reproduction repo if that helps. |
Hello, |
First of all big thanks for great library!
My problem is: current types re-exporting in
index.ts
file break Next.js build because framework strictisolatedModules
to be enabled. This issue can be solved with rewriting exports manually after client generation, but will be better if this will be solved on library level.The text was updated successfully, but these errors were encountered: