Running into issues with content security policy #2027
-
Hello, My team is working on migrating our data visualization tool built in React (w/ webpack) from Leaflet to Deck.gl to take advantage of the graphics acceleration. We are using react-map-gl to provide a base map. We are a research team at a university, which means we have a strict content security policy we have to adhere to, so as I've been trying to deploy our app I've run into issues with mapbox trying to create workers from a blob. We have been using react-map-gl v5 with mapbox-gl to avoid the auth token, but since working on this issue I switched to the latest release with maplibre. Below is the file that does everything Deck.gl and react-map-gl related. Far from our whole app, but nothing else deals with these packages.
The latest thing I have tried is setting the Any help with fixing this would be greatly appreciated! A subset of the resources that have helped: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
If you want to use maplibre, then you need to look at maplibre's documentation. https://maplibre.org/maplibre-gl-js-docs/api/#csp-directives |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
The
mapboxgl.supported
function creates a worker from a blob URL to check worker support, regardless of whether you are using the CSP compliant alternatives.mapboxgl.supported = () => true
will remove the violations.