You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a ts-patch transformer to transform some code before it's executed.
The problem is the tool I'm trying to call (like much of npm nowadays...) expects an async call.
So I start adding await before the call, and moving up in my code transforming functions to async as I go.
And I hit a wall when I get down to the level of ts-patch / the transformer itself... It expects sync functions, and won't do await / deal with any kind of async function.
Is there any way to get this to work? Some kind of solution I'm not considering?
Any help would be very much appreciated.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered:
Hello @arthurwolf
The problem is that typescript compiler api is completely synchronous at that moment, that means that transformers can't return a Promise<ts.Node>, only ts.Node
If you need some data that is asynchronous - you should wait for this data before typescript compilation process will be called
Hello.
I'm trying to create a ts-patch transformer to transform some code before it's executed.
The problem is the tool I'm trying to call (like much of npm nowadays...) expects an async call.
So I start adding await before the call, and moving up in my code transforming functions to async as I go.
And I hit a wall when I get down to the level of ts-patch / the transformer itself... It expects sync functions, and won't do await / deal with any kind of async function.
Is there any way to get this to work? Some kind of solution I'm not considering?
Any help would be very much appreciated.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: