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

Unexpected errors when running in a React Native project #10

Open
jmarek-sky opened this issue May 11, 2021 · 2 comments
Open

Unexpected errors when running in a React Native project #10

jmarek-sky opened this issue May 11, 2021 · 2 comments

Comments

@jmarek-sky
Copy link

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

@jmarek-sky jmarek-sky changed the title Unexpected errors when running in an React Native project repo Unexpected errors when running in a React Native project May 11, 2021
@c-vetter
Copy link
Owner

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 🙂

@jmarek-sky
Copy link
Author

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:

  1. git clone [email protected]:jar0s/reactNative-babel-wla.git
  2. cd reactNative-babel-wla
  3. yarn install
  4. cd ios_template && pod install && cd ..
  5. npx tsconfig.js --once
  6. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants