-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
tsimp does not work with TypeScript v5.6.2 #29
Comments
v5.6.x is not compatible with tsimp. tapjs/tsimp#29
It looks to me like this was broken with microsoft/TypeScript#58825 which modified the implementation of the I think the solution is just to pass
I'll try to put up a PR and see if the maintainers here agree |
Thank you @mattdean-digicatapult. Until the PR get merged, I'm patching locally using the following diff --git a/dist/esm/service/resolve-type-reference-directive-references.js b/dist/esm/service/resolve-type-reference-directive-references.js
index d285ff041190ba2cf2958b00831c089e175fd788..9f33eebec9a498afd0455331ba7aa10d7aa0de89 100644
--- a/dist/esm/service/resolve-type-reference-directive-references.js
+++ b/dist/esm/service/resolve-type-reference-directive-references.js
@@ -21,7 +21,7 @@ export const getResolveTypeReferenceDirectiveReferences = (host, moduleResolutio
const loader = createLoader(containingFile, redirectedReference, options, host, resolutionCache);
for (const entry of entries) {
const name = loader.nameAndMode.getName(entry);
- const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
+ const mode = loader.nameAndMode.getMode(entry, containingSourceFile, options);
const key = createModeAwareCacheKey(name, mode);
let result = rtrdrInternalCache.get(key);
if (!result) { |
same issue |
fwiw, this bug makes the node test runner appear to pass the tests when they should fail. // fail.ts
import { test } from 'node:test'
import { strict as assert } from 'node:assert'
test('should fail', t => {
assert.fail('should fail')
}) running the following command # Node.js v22.9.0
node --import=tsimp/import --test fail.ts outputs ✔ fail.ts (1365.779513ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 1379.271959 EDIT: it appears to fail silently on all usages, not just in the test runner. |
Hi, @isaacs, Can you take a look at this issue? This issue has prevented me from upgrading TypeScript. |
He's shown zero interest in this project recently (as is his right). Until that changes, the only sustainable path forward for us is to fork and maintain it ourselves, or to move to another solution (probably tsx with a separate type-checking step). Even before this issue occurred, there were severe caching issues that often required killing the daemon just to get code changes to apply. This package is simply not production-ready yet (though I really hope it gets there one day, whether by @isaacs or someone else). I took a stab at fixing the caching issues, but it didn't seem to work: #22 |
Yeah, this is definitely somewhat stalled at the "proof of concept" stage. If someone wanted to pick up the baton and try to get it over the finish line (or some other kind of sports metaphor?) I'd love to see it and would be happy to collaborate or smoke-test as I have time to. Startup work is taking up all my time right now, which unfortunately doesn't leave much for tsimp, despite it being (I think) a promising idea. |
@isaacs The most acute problem now is the impossibility of using new versions of TypeScript together with tsimp Could we merge PR and publish a patch release for this? The second problem in my opinion is related to the caching features that @NoahAndrews spoke about |
@isaacs Okay, I will maintain I am also working for a startup and thus have less time to contribute, but because I need My npmjs account is https://www.npmjs.com/~gfx |
tsimp is absolutely not ready for recommendation in a book (unless maybe you're also wanting to fix the caching issues?) |
@NoahAndrews lol. It's off-topic, but IIUC |
You can also just call |
Another idea to consider is using Deno 2.0. It has TypeScript support built-in (including actual type checking, unlike things like tsx) and is supposedly fully compatible with Node, so it could be a good alternative. I agree ts-node is dead though. |
I also have a fork of ts-node that tap uses (which tsimp was intended to replace, and probably would have, had I not gotten distracted by doing another startup and needing to make money which is apparently required just to live, in this capitalist dystopia). Might try using that. |
@gfx tsimp 2.0.12 with typescript 5.6.3 works for me Can you confirm that issue solved? |
@krutoo It works for me, too! FYI, I had to remove the Resolved. |
Error messages in
.tsimp/daemon/log
:It works with older TypeScript compilers, so it might be a regression in TypeScript.
The text was updated successfully, but these errors were encountered: