Skip to content
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

not working with typescript 5.6.1-rc #266

Closed
spdaley opened this issue Sep 7, 2024 · 10 comments · Fixed by #301
Closed

not working with typescript 5.6.1-rc #266

spdaley opened this issue Sep 7, 2024 · 10 comments · Fixed by #301
Labels
Bug Something isn't working

Comments

@spdaley
Copy link
Contributor

spdaley commented Sep 7, 2024

I know typescript 5.6 isn't GA yet but I was curious to see our project worked with it. Unfortunately it looks like typescript-transform-paths may not work with it at this time? This is the error I got:

$ tspc --resolveJsonModule && find dist/src -name "*" -print0  | xargs -0 -I '{}' touch -t 202001010101 '{}'
evalmachine.<anonymous>:126305
              throw e;
              ^

TypeError: tsInstance.getOriginalSourceFile is not a function
    at /Users/seadaley/workspace/centenario/node_modules/typescript-transform-paths/dist/transformer.js:118:48
    at tspWrappedFactory (evalmachine.<anonymous>:228:31)
    at transformSourceFileOrBundle (evalmachine.<anonymous>:95535:49)
    at transformation (evalmachine.<anonymous>:118782:14)
    at transformRoot (evalmachine.<anonymous>:118805:71)
    at transformNodes (evalmachine.<anonymous>:118790:70)
    at emitJsFileOrBundle (evalmachine.<anonymous>:119335:24)
    at emitSourceFileOrBundle (evalmachine.<anonymous>:119293:5)
    at forEachEmittedFile (evalmachine.<anonymous>:119057:24)
    at emitFiles (evalmachine.<anonymous>:119275:3)

It looks like this method may have been removed from 5.6 in this PR microsoft/TypeScript#56817

@danielpza danielpza added the Bug Something isn't working label Sep 7, 2024
@samchon
Copy link

samchon commented Sep 10, 2024

It is not working in the formal typescript@5.6.2 release either.

samchon added a commit to samchon/typescript-transform-paths that referenced this issue Sep 10, 2024
Failed to compile `transform-typescript-paths` due to many TypeScript compilation errors. Therefore, don't know whether this PR is valid or not. Hope your strict your review @nonara.

Instead, tested on my project manually editing the JS file in the `node_modules/typescript-transform-paths` directory.
@nonara
Copy link
Collaborator

nonara commented Sep 10, 2024

Thanks! I'll take a look at the new compiler and see what the new method is for that.

@MeirionHughes
Copy link

Same

tsInstance.getOriginalSourceFile is not a function

annoying that ts keep making breaking changes to the transform api on minor versions.

@AmrAnwar
Copy link

Not working with us also

@bantao-kainos
Copy link

Not working for me as well.
Can we add a version compatibility matrix in the README Please -- this would be great to guide us on which combinations work with which TypeScript compiler versions

@anthonylau
Copy link

Not working for me as well.
Is there any alternative?

@danielpza
Copy link
Member

There's #270 open, we need to make some tests to make sure we don't break compatibility with previous typescript versions, otherwise it would constitute a breaking change.
Currently the builds are failing, so there's more work to do to support the new version.

Of course, you are welcome to contribute in any way, either adding tests, fixing the builds issues, or otherwise :)

@akshoyduya
Copy link

Working with the below versions for me

"typescript": "5.5.4",
"typescript-transform-paths": "3.4.11"

@blimmer
Copy link
Contributor

blimmer commented Nov 2, 2024

@danielpza - I fixed the test suite and resolved this issue with #301. Please review when you've got the bandwidth. Thanks!

@danielpza
Copy link
Member

We just released a new version with the fix v3.5.2.

Thanks to @blimmer and @samchon for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
10 participants