-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Double Typescript compilation #70
Comments
Hmmm I can't seem to reproduce this locally, can you please create a minimal repro? 🙏 |
OK, here is a minimal repro. The key is that this won't happen if the tsconfig does not have Thanks for looking into this! |
We looked into this some more, and what is happening is a known bug in ts-node: Avoid double-transformation of a file when multiple ts-node hooks are registered. That is, in the repro, we have
and so that registers one ts-node, and then this loader registers another one, leading to double compilation. From that report, I don't see a workaround that cosmicconfig-typescript-loader can use to avoid this. Instead, clients will need to not use |
Unless you can use
|
Well, that's a pain, I'd rather not use |
I've had a brief look this morning and transpiling the source passed in works a treat, except that this method means that there is no assertion of the type system. I'll look into it more when I can, but I'm fairly swamped at the moment 😔 |
Thanks. For now I've switched to using TSC on the project, so that this is the only ts-node in play. |
Using cosmiconfig-typescript-loader 4.3.0, my cosmic config setup has
In the same project, as a test, I have
docu-notion.config.ts
:But at runtime, when I run my project using
ts-node
on my index.ts, I getNotice, for example, that the original had a type on
block
, but here in the error, it as if the typescript annotations were stripped away.Any chance someone can see what I'm doing wrong here? If not I can work on a minimal repro.
Thanks!
The text was updated successfully, but these errors were encountered: