react-native-maps-directions icon indicating copy to clipboard operation
react-native-maps-directions copied to clipboard

Blank Screen in Production Mode

Open krishna-gujjjar opened this issue 2 years ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

The current version of this package does not work well with [email protected]. The Error shows that I got that error in the react-native-maps-directions.

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-maps-directions/.eslintignore b/node_modules/react-native-maps-directions/.eslintignore
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/.eslintrc b/node_modules/react-native-maps-directions/.eslintrc
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/.github/workflows/format_eslint.yml b/node_modules/react-native-maps-directions/.github/workflows/format_eslint.yml
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/CHANGELOG.md b/node_modules/react-native-maps-directions/CHANGELOG.md
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/LICENSE.md b/node_modules/react-native-maps-directions/LICENSE.md
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/README.md b/node_modules/react-native-maps-directions/README.md
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/index.d.ts b/node_modules/react-native-maps-directions/index.d.ts
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/index.js b/node_modules/react-native-maps-directions/index.js
old mode 100644
new mode 100755
diff --git a/node_modules/react-native-maps-directions/src/MapViewDirections.js b/node_modules/react-native-maps-directions/src/MapViewDirections.js
old mode 100644
new mode 100755
index ac08d73..6347b44
--- a/node_modules/react-native-maps-directions/src/MapViewDirections.js
+++ b/node_modules/react-native-maps-directions/src/MapViewDirections.js
@@ -1,6 +1,6 @@
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-import MapView from 'react-native-maps';
+import {Polyline} from 'react-native-maps';
 import isEqual from 'lodash.isequal';

 const WAYPOINT_LIMIT = 10;
@@ -220,7 +220,7 @@ class MapViewDirections extends Component {
 		})
 			.catch(errorMessage => {
 				this.resetState();
-				console.warn(`MapViewDirections Error: ${errorMessage}`); // eslint-disable-line no-console
+				console.warn(`MapViewDirections Error: `, errorMessage); // eslint-disable-line no-console
 				onError && onError(errorMessage);
 			});
 	}
@@ -305,7 +305,7 @@ class MapViewDirections extends Component {
 		} = this.props;

 		return (
-			<MapView.Polyline coordinates={coordinates} {...props} />
+			<Polyline coordinates={coordinates} {...props} />
 		);
 	}

diff --git a/node_modules/react-native-maps-directions/v2.md b/node_modules/react-native-maps-directions/v2.md
old mode 100644
new mode 100755

This issue body was partially generated by patch-package.

krishna-gujjjar avatar Jul 17 '22 15:07 krishna-gujjjar

What is the version of react-native-maps? The last commit fixed an issue with version 1.0.0. Might need to update the peerDependencies constraint there to reflect this.

bramus avatar Jul 18 '22 08:07 bramus

Yes, [email protected] fixed this issue.

Thanks

krishna-gujjjar avatar Aug 15 '22 04:08 krishna-gujjjar