Source code transpiles, but emitted declarations filled with errors
See original GitHub issueI apologize if I shouldn’t be opening an issue about this.
I asked about debugging long compile times before in another issue, #24435
This issue right now is related to that but in a different way.
The typed-orm
project transpiles quickly now, after an unintuitive solution, but the emitted declarations appear “unusable” by other projects (at least according to tsc
).
ts-node
and VS code don’t seem to have a problem with the emitted declarations and seem to run just fine.
TypeScript Version: 2.9.1
Search Terms: emit declarations incorrect
Code
import * as o from "typed-orm";
o;
And then run tsc --noEmit --diagnostics
A repo that reproduces the problem can be found here
Expected behavior:
Success after about 17 seconds
Actual behavior:
Errors after about 37s
The list of errors is… Rather large.
I have a different project that is using typed-orm
and ts-node
seems to run it fine. VS code also seems to do some type checking fine (seems to, maybe it skips some more involved checks, or does incremental checking, I have no idea).
However, when I try to run tsc
(checking types/transpiling), node
just runs out of memory, even after giving it 8GB of RAM.
I tried to debug what was wrong. The typed-orm
project itself transpiles very quickly, now. I figured there must be something wrong with that project. However, after removing a lot of code, I still got out-of-memory exceptions.
In the end, I created an entirely new project, wrote that snippet above, and saw that even though the source code for typed-orm
transpiles, the transpiled declarations seem to have errors.
Link to example: here
Link to typed-orm
: here
Related Issues: #24435
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
Actually, I’m pretty sure those paths are the expected and desired output when
baseUrl
is set, given thatbaseUrl
is for multiproject/application scenarios (so you saybaseUrl
is your workspace root, then use nonrelative paths for each workspace folder). Why do you havebaseUrl
set in your tsconfig; with a quick look I can’t find any paths in your application that should rely on it to work?Random question; are these types the same? (They seem to be)
And