0

I compiled my application made with nativescript + vuejs + typescript, and I see a lot of error like this : "Cannot find name 'RandomName'."

Most of the time it is because of names like : UIEdgeInsetsMake, Webview, Label etc...

I would like to know if there is a flag in the tsconfig file that "allows" this of error ? I don't want to make a change for each of these error because anyway the app runs well on device & simulator.

If there is a easy solution other than changing tsconfig it s ok for me also.

Thanks a lot !

Neiluj
  • 113
  • 12
  • You're missing the point of using TS. What you intend to do makes TS type safety pointless. You need to have type declarations for every variable you use. If a declaration is supposed to exist but is unavailable then you ask a wrong question, consider focusing on how to fix this. If you don't need the benefits of TS, don't use it, that's what Babel is for – Estus Flask Sep 28 '22 at 16:19
  • Ok thanks, I got the idea :-) How is it possible to declare these kind of variables : UIEdgeInsetsMake, Webview, Label... For example I these lines that generate the error : "webView.nativeView.scrollView.contentInset = UIEdgeInsetsMake(0,-5,0-5);" "const webView = args.object as WebView;" Is there a way to declare these in my application or in a file in /types ? – Neiluj Sep 28 '22 at 17:16
  • See https://stackoverflow.com/questions/38906359/create-a-global-variable-in-typescript – Estus Flask Sep 28 '22 at 18:37

0 Answers0