Esri / esri-loader

A tiny library to help load ArcGIS API for JavaScript modules in non-Dojo applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Map csp-restrictions with Graphics issue

fadelghandour opened this issue · comments

Expected behavior

  • Using react (create-react-app), I installed esri-loader (latest)
    npx create-react-app mymap
    cd mymap
    npm add --save esri-loader

  • Created a simple Map

  • Added a graphic into MapView

  • Added:
    dojoConfig: {
    has: {
    'csp-restrictions': true,
    },
    }

  • The graphic should appear

  • Tested on Ubuntu 18 and Windows 10, node version 11.10.1 (tested on other node versions also)

  • ArcGIS API 4.14

Actual behavior

  • When setting the "csp-restrictions" to true, the graphic will not appear anymore.
  • The issue also tested on ArcGIS API 4.13, 4.12 and 4.11, graphic is not visible.
  • Nothing appears in the console

Steps to reproduce the behavior

This appears to be related to recent comments in this post.
https://community.esri.com/groups/geodev/blog/2019/09/05/content-security-policy-and-the-arcgis-api-for-javascript

I was able to reproduce this behavior without esri-loader being involved.

For example, you can add a new <script></script> with the same dojoConfig values in this 4.x graphics sample page.

image

commented

Closing due to no activity.