tsconfig.js
tsconfig.js copied to clipboard
Unexpected errors when running in a React Native project
I have a pretty standard project using React Native. It. has some cocoapods installed or the iOS version.
When I run npx tsconfig.js --once
I get heaps (3829 to be exact) of errors like the one below (I included only the last one as all of them are basically the same)
error: Invalid or unexpected token
error: Error while processing /path/to/rn/project/ios/Pods/Analytics/Segment/Internal/UIViewController+SEGScreen.h
error: Unexpected identifier
info: Processing complete, with 3829 errors, see above for details
npm ERR! code 1
npm ERR! path /path/to/rn/project
npm ERR! command failed
npm ERR! command sh -c tsconfig.js "--once"
It seems that tsconfig.js tried to process all *.h
files unnecessarily. When I enabled the debug logs, I saw:
debug: Looking for files matching [
/path/to/rn/project/**/tsconfig.js
]
None of the *.h
files match that pattern so I guess it must be some sort of a bug.
I worked around it by ignoring the ios folder and running npx tsconfig.js --once -- ios
Hello @jmarek-sky Thank you for the bug report! Can you provide a simple reproduction for debugging? I'd like to add that as a test case.
A quick look at the code there's no obvious source for such an error. Except if chokidar did this wrong, but I doubt that and I found no similar issue in their repository.
Additional feedback would be appreciated, thanks 🙂
Hi @c-vetter Sorry for a very delayed response, but I missed the email notification from GitHub among heaps of other emails. I encountered the same issue in one of my pet projects which is open sourced, so I can share the steps to reproduce with you:
-
git clone [email protected]:jar0s/reactNative-babel-wla.git
-
cd reactNative-babel-wla
-
yarn install
-
cd ios_template && pod install && cd ..
-
npx tsconfig.js --once
- Observe errors in the console output, last few:
error: Error while processing /path/to/reactNative-babel-wla/ios_template/Pods/CocoaAsyncSocket/Source/GCD/GCDAsyncSocket.h
error: Unexpected identifier
error: Error while processing /path/to/reactNative-babel-wla/ios_template/Pods/CocoaAsyncSocket/Source/GCD/GCDAsyncUdpSocket.h
error: Unexpected identifier
info: Processing complete, with 3702 errors, see above for details