Skip to content
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

Cannot specify map type or any other GoogleMutant property #24

Open
Matthias-Claes opened this issue Oct 25, 2021 · 6 comments
Open

Cannot specify map type or any other GoogleMutant property #24

Matthias-Claes opened this issue Oct 25, 2021 · 6 comments

Comments

@Matthias-Claes
Copy link

Matthias-Claes commented Oct 25, 2021

When I'm trying to specify the map type I get this error:
'Property 'type' does not exist on type 'IntrinsicAttributes & LayerProps & IProps & RefAttributes'.'

In fact, I cannot seem to set any of the GoogleMutant properties

My code:

<ReactLeafletGoogleLayer apiKey={config.googleMapsApiKey} type="satellite" />

I am using react leaflet v3 and using v2.0.4 of this library

@Matthias-Claes Matthias-Claes changed the title Cannot specify map type Cannot specify map type or any other GoogleMutant property Oct 25, 2021
@aviklai
Copy link
Owner

aviklai commented Oct 25, 2021

@Matthias-Claes Hi,

Can you please add a codesandbox to show the issue?

@aardvarkk
Copy link

I'm also seeing this issue in VS Code, but it's not reproducible in CodeSandbox. I think it's something around the fact that the type L.gridLayer.GoogleMutantOptions seems to exist as a side-effect of import 'leaflet.gridlayer.googlemutant';. For some reason, VS Code seems to import L.gridLayer.GoogleMutantOptions as an any type. Here's a screenshot of the issue:

image

@aardvarkk
Copy link

I've been trying to narrow down the issue and it seems that if I remove "react-leaflet": "^3.2.2", as a dependency, the error goes away. When I add it back, the error returns. However, I have a minimal test project going that also includes react-leaflet and it doesn't seem to have the same problem, so I'm continuing to dig into it.

@aardvarkk
Copy link

OK -- so the problem can be fixed by upgrading yarn. I was using version 3.0.2, and upgrading to version 3.2.0-rc.3 fixes the problem. Examining https://github.com/yarnpkg/berry/blob/master/CHANGELOG.md for v3.1.0, it looks like perhaps the relevant line is maybe:

Direct portal dependencies for node_modules installs will now be given priority during hoisting, preventing cases when indirect regular dependencies would block the way for direct portal dependencies.

However, I don't understand what most of those words mean so it could have been something else they changed. Anyway, I think the solution to this one might be just to upgrade yarn.

@dennisat
Copy link

dennisat commented Aug 6, 2024

I have the same now (after three years) in react-leaflet version 4.2.1

@aviklai
Copy link
Owner

aviklai commented Aug 6, 2024

@dennisat Hi, can you please add a codesandbox with the issue?

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

No branches or pull requests

4 participants