-
-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Typescript conversions fails to compile (ShapeSource, PointAnnotation) #2264
Comments
Last compiling version was 10 beta 39 |
@mvniekerk can you please also add the error you're seeing |
For me this compiles: import { Geometry } from 'geojson';
const aLine: Geometry = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
}; Full sample: import React from 'react';
import {
MapView,
ShapeSource,
LineLayer,
Camera,
PointAnnotation,
ShapeSource
} from '@rnmapbox/maps';
import { Geometry } from 'geojson';
const aLine: Geometry = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
};
class BugReportExample extends React.Component {
render() {
return (
<MapView style={{flex: 1}}>
<Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
<ShapeSource id="idStreetLayer" shape={aLine}>
<LineLayer id="idStreetLayer" />
</ShapeSource>
</MapView>
);
}
} |
I get this error: SyntaxError: C:\Users\ronal\Documents\Programming\react-native\MobilizeReporting\node_modules@rnmapbox\maps\javascript\components\PointAnnotation.tsx: Unexpected token (122:43) 120 | */
|
Sorry for the late reply @mfazekas , but what @BubbleTrouble14 has commented here #2264 (comment) |
@mvniekerk @BubbleTrouble14 and what is the command you're running?! |
I just start the app and get the error, after removing all imports from mapbox it works. |
If you open the TSX files in Intellij it even errors out there as well.
It breaks at compiler level - the files aren't valid Typescript.
Groete / Best regards
Michael van Niekerk
…________________________________
Van: Ronald Goedeke ***@***.***>
Gestuur: Sunday, October 2, 2022 10:05:00 PM
aan: rnmapbox/maps ***@***.***>
Aa: Michael van Niekerk ***@***.***>; Mention ***@***.***>
onderwerp: Re: [rnmapbox/maps] [Bug]: Typescript conversions fails to compile (ShapeSource, PointAnnotation) (Issue #2264)
I just start the app and get the error, after removing all imports from mapbox it works.
—
Reply to this email directly, view it on GitHub<#2264 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAL7O74AECQULSXOTXKOG6TWBHTGZANCNFSM6AAAAAAQ2O2ZPU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sorry not enough detail to reproduce |
Having the same issue. I just upgraded my packages from an old mapbox-gl version where everything in my app was running fine. Now I get this error upon opening the app. I removed all Mapbox components but kept the import and am still getting the error.
This is an error in library code, not my code. |
You have the files that is failing and you have tsc, why close the ticket @mfazekas? |
Yes exactly the same for me. I created whole new project from scratch to test if I can get it to work. Works fine. But still havent figured out where the difference is to my existing project to fix the problem. Deleted node modules, cleaned project, rebuilt... |
I'll give it a go, thx. |
@BubbleTrouble14 maybe you have and old typescript version in your project, can you tell me which typescript are you using from the pacakge-lock or yarn.lock file?! |
@mfazekas what version should we be on for it to work? My yarn.lock says
|
Found it. Says: "version": "4.6.4" |
@BubbleTrouble14 @mfazekas @mvniekerk Updated to latest (4.8.4), same problem. Removing type annotations from PointAnnotation and ShapeSource like this fixed it for me: to My app now runs. This is obviously a temporary fix though, would like to figure out what's wrong. I'm on a slightly old RN version: 0.68.2 |
@allthetime did you check you are actually using 4.8.4 after your upgrade? Try running |
@KiwiKilian I'm not who you referenced, but here is a log after updating from v8 to v10 of my app:
|
@huszzsolt as a short term fix I recommend self-patching and using
simply remove
I was having this issue before, but am not anymore, but I'm not sure what I did. I'm using the latest version of Also, I'm on Might want to check your typescript version. |
Have managed to get Problem (I think) has been corrected by updating my
After this, in my case, I also needed to install
Have different issues to deal with now, so not out the woods yet! But HTH. /edit - best to make sure all versions of the above components are aligned, otherwise you'll get more TS compiler ball ache after deleting
FYI the error I got second time around, resolved by fixing the version numbers, was:
|
Hi @mfazekas what should I have to do in my case? |
@chrisivo I am freaking out here... I have been working on this for quite a while, but I cannot get it to work. I am getting the same error you mentioned
But I cannot solve it. This are my
This is the
and this is from the
Do you have a hint why I am still seeing this error? |
Me too , am having similar error but in my case its, VectorSource.tsx. error: node_modules/@rnmapbox/maps/src/components/VectorSource.tsx: /Users/node_modules/@rnmapbox/maps/src/components/VectorSource.tsx: Unknown node type: "TSInstantiationExpression" |
@Stophface HI!, Did you solve it? |
Mapbox Implementation
Mapbox
Mapbox Version
default
Platform
iOS, Android
@rnmapbox/maps
version#main
Standalone component to reproduce
Observed behavior and steps to reproduce
It doesn't compile because the files aren't Typescript.
Expected behavior
It compiles
Notes / preliminary analysis
Provided Typescript files are not compiling
Additional links and references
None
The text was updated successfully, but these errors were encountered: