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

ttsc --watch not working when upgrade typescript-transform-paths to 2.0.3 #78

Closed
Val-istar-Guo opened this issue Nov 23, 2020 · 5 comments · Fixed by #81
Closed

ttsc --watch not working when upgrade typescript-transform-paths to 2.0.3 #78

Val-istar-Guo opened this issue Nov 23, 2020 · 5 comments · Fixed by #81
Labels
Duplicate This issue or pull request already exists

Comments

@Val-istar-Guo
Copy link

  • "typescript-transform-paths": "^2.0.3"
  • "ttypescript": "^1.5.12",
  • "typescript": "^4.1.2",
  • "typescript-nestjs-swagger-plugin": "^1.1.0",
***/node_modules/typescript/lib/typescript.js:14332
 :ts.skipTrivia(sourceFile.text, errorNode.pos);

TypeError: Cannot read property 'text' of undefined

Operating procedures:

  • ttsc --watch
  • change some ts file that be watched
  • The error throw

cevek/ttypescript#92

@nonara
Copy link
Collaborator

nonara commented Nov 23, 2020

Thanks for filing!

I was working on a similar issue today and was able to work out what's going on.

In your case, the short version is, the parent node isn't being set on our workaround node. There also doesn't seem to be a way that we can do it without messing up the output.

You can read more on that if you're interested in this issue. Ultimately, we're going to have to wait on TS to fix the issue that we've been working around.

The TS issue is in the roster for 4.2.0, and I'm keeping an eye on it.

I'm going to leave this issue open also, however, so that when we have a fix, I'll be sure to test your watch-mode case specifically.

@nonara nonara added Awaiting Upstream Fix Bug-fix for dependency is in progress Duplicate This issue or pull request already exists labels Nov 23, 2020
@jonathanj
Copy link

@nonara Just checking if this is different from #72? You commented on a few days ago indicating that the issue there is fixed, but my understanding of the two issues is that they are the same.

I'm experiencing the same issue above trying to use [email protected] on [email protected] with [email protected], except I'm not specifying --watch I'm just trying to compile my TS project to JavaScript + TS declarations for publishing purposes.

yarn run v1.22.5
$ /Users/jonathan/Coding/yoco/design-system-react-native/node_modules/.bin/ttsc --declaration --project .
/Users/jonathan/Coding/yoco/design-system-react-native/node_modules/typescript/lib/typescript.js:106219
                throw e;
                ^

TypeError: Cannot read property 'text' of undefined

@nonara
Copy link
Collaborator

nonara commented Nov 23, 2020

@jonathanj It is different than #72, though somewhat related. It is a duplicate of #77

In v2.0.3, we were able to alleviate the issue for many cases, however, as these two issues have shown, there are still edge cases where it breaks.

Background:

It appears at the moment that our only option is to wait for a fix in TS. I've talked to some MSFT folks and gotten some detail on where to look, so I'll be looking at the TS source today to see if I can help expedite a fix for the TS issue. Once we can drop the workarounds, all of these issues will be settled.

@nonara nonara mentioned this issue Nov 26, 2020
1 task
@nonara nonara removed the Awaiting Upstream Fix Bug-fix for dependency is in progress label Nov 27, 2020
@nonara
Copy link
Collaborator

nonara commented Nov 27, 2020

Just a heads up - this is fixed in v2.1.0. We implemented proper type elision. No more workarounds.

If interested, more detail can be found in #81

@Val-istar-Guo
Copy link
Author

@nonara Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants