Skip to content

Conversation

Med-Li-Jr
Copy link

@Med-Li-Jr Med-Li-Jr commented May 5, 2025

Description

Fixes #3756
File Changed : MapView.tsx

Added your feature that allows ...

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Screenshot OR Video

Component to reproduce the issue you're fixing

…null found with tag )

It's a fix for this issue : rnmapbox#3756
@Med-Li-Jr Med-Li-Jr temporarily deployed to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Inactive
@Med-Li-Jr Med-Li-Jr had a problem deploying to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Error
@Med-Li-Jr Med-Li-Jr temporarily deployed to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Inactive
@Med-Li-Jr Med-Li-Jr temporarily deployed to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Inactive
@Med-Li-Jr Med-Li-Jr temporarily deployed to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Inactive
@Med-Li-Jr Med-Li-Jr temporarily deployed to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Inactive
@Med-Li-Jr Med-Li-Jr temporarily deployed to CI with Mapbox Tokens May 5, 2025 23:25 — with GitHub Actions Inactive
@@ -1171,6 +1171,14 @@ class MapView extends NativeBridgeComponent(
}
}

if (mapView == null) {
Copy link
Contributor

@mfazekas mfazekas May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this is good way to solve the issue.
mapView will be null if on layout has not been called yet.

Can't we just add an else to set mapView to an empty fragment instead of null?

if (this.state.isReady) {
  ...
} else {
  mapView = <></>
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Med-Li-Jr code works. @mfazekas your suggestion does not work

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mfazekas, yeah me too, I didn't think it was a good way to solve it, but it was the only one amongs the things I tried that solved it on my side, I tried the following, but other errors appeared :

  • Attemp 1 :

       let mapView = {} as NativeMapViewActual;
       if (this.state.isReady) {
          ...
        }
    
  • Attemp 2 :

        let mapView = <RNMBXMapView> </RNMBXMapView>;
        if (this.state.isReady) {
          ...
        }
    
  • Attemp 3 :

        let mapView = <></>;
        if (this.state.isReady) {
          ...
        }
    
  • etc....

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LukasB-DEV, I see, then just changed it on your local code, maybe later, there will be an update that will fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Med-Li-Jr is there a code to reproduce the issue? It's not clear in #3756 how to reproduce the issue

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it dont catches everything. Many times same error also comes, but less frequent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Med-Li-Jr can you reacheck this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahzeb79 , @LukasB-DEV I tried with the init code I don't see the error, Can you share the part of your code that gives the errors ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Med-Li-Jr i face error when lets say i click on icon on map, or state changes on mapscreen. error get triggered but its also random

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahzeb79 I see, so that means it's probably a deep error in the project, it may be coming from another file, we'll have to wait for an official resolution😕

@javier-sauma-rocketlab
Copy link

is there any news on this??

@hakanuskan
Copy link

Any updates?

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

Successfully merging this pull request may close these issues.

[Bug]: Random error: “Mapbox [error] ViewTagResolver | view: null found with tag: xxxx but it's either null or not the correct type”.
6 participants