Can't use in Chrome Extension because of dynamically fetched Maps js API #407
-
Hello, I am building a Chrome extension. Problem:When I try to use the react-google-maps library, I get the following error:
Cause:Chrome extensions aren't allowed to dynamically load scripts. See the doc:
Solution:Is there any way to pre-package the API ? I have found that it is purposely not distributed via NPM. Any other idea or suggestion would be very welcome ! Thank you :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have to say, I have no experience with the new extension APIs, so maybe there are ways to make this work that I am missing at the moment. As far as I can tell from a brief look into the documentation, this isn't going to work.
As far as I know, this isn't going to happen. At this point I'd recommend you use something like maplibre or mapbox with react-map-gl. Those allow you to bundle the entire codebase and will only request configuration data and vector-tiles from the server. |
Beta Was this translation helpful? Give feedback.
I have to say, I have no experience with the new extension APIs, so maybe there are ways to make this work that I am missing at the moment. As far as I can tell from a brief look into the documentation, this isn't going to work.
As far as I know, this isn't going to happen.
At this point I'd recommend you use something like maplibre or mapbox with react-map-gl. Those allow you to bundle the entire codebase and will only request configuration data and vector-tiles from the server.