question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: TypeScript Linting Errors occuring again with Expo SDK 47

See original GitHub issue

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

iOS, Android

@rnmapbox/maps version

10.0.0-beta.56

Standalone component to reproduce

npx tsc --version 
Version 4.8.4

 npx tsc --noemit
node_modules/@rnmapbox/maps/javascript/components/Atmosphere.tsx:25:7 - error TS2322: Type 'ComponentType<any>' is not assignable to type 'HostComponent<{ reactStyle?: { [key: string]: StyleValue; } | undefined; style?: undefined; }>'.
  Type 'ComponentClass<any, any>' is not assignable to type 'HostComponent<{ reactStyle?: { [key: string]: StyleValue; } | undefined; style?: undefined; }>'.
    Type 'Component<any, any, any>' is not assignable to type 'Component<{ reactStyle?: { [key: string]: StyleValue; } | undefined; style?: undefined; }, {}, any> & Readonly<NativeMethods>'.
      Type 'Component<any, any, any>' is not assignable to type 'Readonly<NativeMethods>'.

25 const RCTMGLAtmosphere: HostComponent<{
         ~~~~~~~~~~~~~~~~

node_modules/@rnmapbox/maps/javascript/components/MarkerView.tsx:149:7 - error TS2322: Type 'ComponentType<any>' is not assignable to type 'HostComponent<NativeProps>'.
  Type 'ComponentClass<any, any>' is not assignable to type 'HostComponent<NativeProps>'.
    Type 'Component<any, any, any>' is not assignable to type 'Component<NativeProps, {}, any> & Readonly<NativeMethods>'.
      Type 'Component<any, any, any>' is not assignable to type 'Readonly<NativeMethods>'.

149 const RCTMGLMarkerView: HostComponent<NativeProps> =
          ~~~~~~~~~~~~~~~~

node_modules/@rnmapbox/maps/javascript/components/PointAnnotation.tsx:229:7 - error TS2322: Type 'ComponentType<any>' is not assignable to type 'NativePointAnnotation'.
  Type 'ComponentClass<any, any>' is not assignable to type 'HostComponent<NativePointAnnotationProps>'.
    Type 'Component<any, any, any>' is not assignable to type 'Component<NativePointAnnotationProps, {}, any> & Readonly<NativeMethods>'.
      Type 'Component<any, any, any>' is missing the following properties from type 'Readonly<NativeMethods>': measure, measureInWindow, measureLayout, setNativeProps, and 2 more.

229 const RCTMGLPointAnnotation: NativePointAnnotation =
          ~~~~~~~~~~~~~~~~~~~~~

node_modules/@rnmapbox/maps/javascript/components/ShapeSource.tsx:411:7 - error TS2322: Type 'ComponentType<any>' is not assignable to type 'NativeShapeSource'.
  Type 'ComponentClass<any, any>' is not assignable to type 'HostComponent<NativeProps>'.
    Type 'Component<any, any, any>' is not assignable to type 'Component<NativeProps, {}, any> & Readonly<NativeMethods>'.
      Type 'Component<any, any, any>' is not assignable to type 'Readonly<NativeMethods>'.

411 const RCTMGLShapeSource: NativeShapeSource =
          ~~~~~~~~~~~~~~~~~


Found 4 errors in 4 files.

Errors  Files
     1  node_modules/@rnmapbox/maps/javascript/components/Atmosphere.tsx:25
     1  node_modules/@rnmapbox/maps/javascript/components/MarkerView.tsx:149
     1  node_modules/@rnmapbox/maps/javascript/components/PointAnnotation.tsx:229
     1  node_modules/@rnmapbox/maps/javascript/components/ShapeSource.tsx:411

Observed behavior and steps to reproduce

I once again see TypeScript errors after I upgraded to Expo SDK 47 and Node 18. I yet didn’t find the actual reason as tsconfig.json seems to stay the same aswell as my TypeScript version.

Expected behavior

No response

Notes / preliminary analysis

Is the /javascript directory actually meant to be shipped? Isn’t the stuff in /lib enough?

Additional links and references

See also #2264 and #2333.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KiwiKiliancommented, Nov 16, 2022

@Andarius maybe you want to also try my fix in #2418 – simply change your version of @rnmapbox/maps in the package.json to github:trafficon/rnmapbox-maps#feature/require-native-component-type and check if the linting errors are also fixed for you.

Sadly I wasn’t able to create a reproduction…

0reactions
KiwiKiliancommented, Nov 16, 2022

Ok, then I hope to we get #2418 merged and the next beta should be fine to use again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

expo-linking typescript errors · Issue #17866 - GitHub
Hi! After upgrading SDK version from 44 to 45 our TS linter started to complain about expo-linking library. Here is the error summary...
Read more >
reactjs - Getting typing errors after upgrading expo project
This error is happening with many libraries like react-native-paper, react-native-elements and even the native ones like expo-vector-icons.
Read more >
Enforcing Consistent Code in Expo React Native Projects
In this article, I'm going to walk through starting a brand new Expo tabs project (this whole article can be used for ANY...
Read more >
How to create React Native App for Android, iOS and Web ...
How to create React Native App for Android, iOS and Web without Expo · Step 1: Init a React Native Application: · Step...
Read more >
Bug listing with status RESOLVED with resolution TEST ...
Bug :233 - "Emacs segfaults when merged through the sandbox. ... Bug:131854 - "FlightGear-0.9.10 fails to compile, error occuring in tests/al-info.c" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found