When I use the Geoprocessing of arcgis for js to request the tool service of ArcGIS Server on the local server, I got the following error.

349
3
07-13-2022 05:06 AM
viotbery
New Contributor

After I publish the model, I can get the correct results when I test it locally, but when I use ArcGIS for js, I get the following error when requesting layer results

ReferenceError: Cannot access 'F' before initialization
    at Module.default (MapImageLayer.js:1:1)
    at l.fetchResultMapImageLayer (JobInfo.js:5:2535)

 This is the core source code, everything works fine until the fetchResultMapImageLayer() method is called.

        geoprocessor.submitJob(GPurl, params).then(jobInfo => {
          const jobid = jobInfo.jobId
          console.log('ArcGIS Server job ID: ', jobid)
          console.log(jobInfo)
          const options = {
            interval: 5000,
            statusCallback: () => {
              console.log('running...')
            }
          }

          jobInfo.waitForJobCompletion(options).then((jobInfo2) => {
            console.log(jobInfo2)
            jobInfo2.fetchResultMapImageLayer(jobInfo2.jobId).then((layer) => {
              // _this.map.add(layer)
              console.log(layer)
              _this.fullscreenLoading = false
            }).catch(err => {
              console.log(err)
              _this.fullscreenLoading = false
            })
          })
0 Kudos
3 Replies
viotbery
New Contributor

Arcgis For JS: 4.23.6

Arcgis Server 10.2

0 Kudos
ReneRubalcava
Frequent Contributor

That is odd, I can't repro. The sample does everything you are. Does this also happen with 4.24? I don't think there have been any changes there for a couple of releases. 

0 Kudos
viotbery
New Contributor

Thank you for your reply. I later used esri-loader to load the module to solve this problem. The core I used is version 4.23, because higher than this version will cause when I use vuecli to start, webpack will prompt that the module cannot be loaded, lack of suitable loader

0 Kudos