Select to view content in your preferred language

Deployed site not displaying maps / local version is displaying maps

575
2
06-30-2022 10:14 AM
JoshuaLandry
New Contributor

Hi all,

I'm relatively new to using the ArcGIS API for JS as well as web development and recently created a project that makes use of some maps and open data feature layers.

These work when I'm running the site locally but do not show up when on the deployed version.  The site is deployed via Netlify and I've inputted the API key into the Netlify environment variables.  I've attached some screenshots of what I'm seeing and the settings I have for the API key.

Any and all help would be super appreciated!

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor II

are you getting errors in the console? I'd imagine if it was the api key you would get a login prompt. What are you build tools? How are you referencing the API key env variables in your app? Maybe a repro project? Could be the browserlist? Could be something else, tough to tell.

There are some sample projects here you can look at too.

https://github.com/Esri/jsapi-resources/tree/master/esm-samples

I've seen this issue with default browserlist in some frameworks, check our note here with the react sample

https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app#misc

JoshuaLandry
New Contributor

Hi Rene,

Thanks so much for your response!  To answer your questions:

  • no console errors
  • it is deployed with Netlify and the build command is npm run build
  • The local version was using a .env file and the deployed version has the environment variables stored in the build & deploy settings.
  • I've tried the browserlist fix as well as the config override and those don't seem to be working either.

It appears as if the login credentials are being accepted (like you mentioned, no login prompt) and I'm able to query the FeatureLayer for data but the maps themselves are just not being displayed.

Thanks again for any further potential insight,

Joshua

0 Kudos