Select to view content in your preferred language

Network Errors Referencing Local Assets

135
1
3 weeks ago
MichaelWen_Timmons
Occasional Contributor

My ArcGIS JavaScript API app kept throwing 404 errors retrieving resources online with errors like these: 

  • Code: NoSuchKey
  • Message: The specified key does not exist.
  • Key: br/js/4.28/@arcgis/core/assets/esri/core/workers/RemoteClient.js&wexps=1&_ordtok=N443WVLN5mHQ5NDR505RvtfD6j
  • RequestId: 8RWH1F6N811DS3ZR
  • HostId: 7Nu2F2Huf6wbOsWzhneFbo/+6E2DL4SJQcszGzY/IzCEU7IE6elxxRmchhh+ra76kM/PK2p8EIg=

So I'm trying to download and run arcgis/core file locally.

I've set the asset path:

esriConfig.assetsPath = "assets";

Now I'm getting errors like these: 

404 - http://localhost:4200/assets/esri/widgets/Attribution/t9n/Attribution_en.json   http://localhost:4200/assets/esri/widgets/Attribution/t9n/Attribution.json

Errors occurred while loading "esri/widgets/Attribution/t9n/Attribution"

"Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:4200/assets/esri/core/workers/RemoteClient.js' failed to load."

I could find all of these files under node_modules.

What have I missed?

 

 

 

0 Kudos
1 Reply
AndyGup
Esri Regular Contributor

@MichaelWen_Timmons  typically 404 errors indicate something is not configured correctly. Verify the assets were actually copied: https://developers.arcgis.com/javascript/latest/get-started-npm/#local-assets.

Please provide a minimal reproduction sample. Here's our troubleshooting guide for future reference.