Stack trace doesn't point to error

SDK Version: ~47.0.9
Platforms(Android/iOS/web/all): iOS

Hi folks, I’m developing an iOS app using npx expo start --dev-client. Whenever I make a small syntax error in my code, the error itself shows up in the logs, but it does not give me the location of the error. Instead, after the error, I get a bunch of (what seems to me) irrelevant errors from other modules. Once the syntax error is resolved, all the errors go away.

It’s not a big deal but it would save me a lot of time if I could actually see on what file and what line the actual syntax error is. Is there some problem with my setup that is causing this issue?

Here’s an example. Somewhere in my code I have an undefined variable, and it tells me that on the first line, but it doesn’t tell me where the error is. All the output after that seems completely unrelated, and it’s always the same no matter what the actual error in my code is. In other words – the very first line is related to the error, and the stuff about the DatePickerIOS just appears randomly every time I have an error, and disappears again when I correct the syntax error in my own code.

 ERROR  ReferenceError: Can't find variable: templateKey
// ^ This is the actual syntax error, but this is all the info I get; no location info
// Stack trace continues below with unrelated errors from internal libraries, which vanish when
// the above error is resolved.
Error: Unable to resolve module ./Libraries/Components/DatePicker/DatePickerIOS from /Users/.../node_modules/react-native/index.js:

None of these files exist:
  * node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS(.native|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json)
  * node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS/index(.native|.native.ts|.ts|.native.tsx|.tsx|.native.js|.js|.native.jsx|.jsx|.native.json|.json)
  15 | import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
  16 | import typeof Button from './Libraries/Components/Button';
> 17 | import typeof DatePickerIOS from './Libraries/Components/DatePicker/DatePickerIOS';
     |                                   ^
  18 | import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
  19 | import typeof FlatList from './Libraries/Lists/FlatList';
  20 | import typeof Image from './Libraries/Image/Image';

// this continues on for a long time...

Any help greatly appreciated, thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.