-
-
Notifications
You must be signed in to change notification settings - Fork 936
[Bug]: Unexpectedly found nil while implicitly unwrapping an Optional value #4189
Copy link
Copy link
Open
Labels
bug 🪲Something isn't workingSomething isn't working
Description
Mapbox Version
default
React Native Version
0.84.1
Platform
iOS
@rnmapbox/maps version
10.3.0
Standalone component to reproduce
import React from 'react';
import {
Images,
MapView,
ShapeSource,
LineLayer,
Camera,
} from '@rnmapbox/maps';
const aLine = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
};
class BugReportExample extends React.Component {
render(props) {
return (
<MapView style={{flex: 1}}>
{/* real images object should be passed with at least one png */}
<Images images={{}} />
<Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
<ShapeSource id="idStreetLayer" shape={aLine}>
<LineLayer id="idStreetLayer" />
</ShapeSource>
</MapView>
);
}
}Observed behavior and steps to reproduce
After upgrading to RN 0.84.1, app on iOS started crashing immediately due to usage of the <Images images={images} /> component with a native error saying Unexpectedly found nil while implicitly unwrapping an Optional value. Images object can be as simple as {icon: importedPngIcon}
Does not crash if no images are passed into component
Tried using both images/nativeAssetImages
Happens in both debug and release modes
Xcode 26.4, but happened on 26.3 version as well
import React from 'react';
import {
Images,
MapView,
ShapeSource,
LineLayer,
Camera,
} from '@rnmapbox/maps';
const aLine = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
};
class BugReportExample extends React.Component {
render(props) {
return (
<MapView style={{flex: 1}}>
{/* real images object should be passed with at least one png */}
<Images images={{}} />
<Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
<ShapeSource id="idStreetLayer" shape={aLine}>
<LineLayer id="idStreetLayer" />
</ShapeSource>
</MapView>
);
}
}
Expected behavior
App should not crash
Notes / preliminary analysis
No response
Additional links and references
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🪲Something isn't workingSomething isn't working