Esri / esri-wab-build

Package used to build ESRI Web App Builder Apps for production.
Apache License 2.0
17 stars 5 forks source link

404 errors and missing JSAPI dependencies #66

Open sbuscher opened 5 years ago

sbuscher commented 5 years ago

I created a vanilla app (just a basemap) with WAB Dev Edition 2.11 and built it using esri-wab-build 1.1. After setting up ..\buildOutput\app in my local IIS the app wouldn't load due to 404 errors:

simpleLoader.js:80 GET https://localhost/https://localhost//jsapi/jsapi/dojo/resources/dojo.css net::ERR_ABORTED 404 simpleLoader.js:80 GET https://localhost/https://localhost//jsapi/jsapi/dijit/themes/claro/claro.css net::ERR_ABORTED 404 simpleLoader.js:80 GET https://localhost/https://localhost//jsapi/jsapi/esri/css/esri.css net::ERR_ABORTED 404 createElement @ simpleLoader.js:80 https://localhost/https://localhost//jsapi/jsapi/dojox/layout/resources/ResizeHandle.css net::ERR_ABORTED 404 simpleLoader.js:80 GET https://localhost/https://localhost//jsapi/jsapi/init.js net::ERR_ABORTED 404

Note the extra 'https://localhost/' in the url. There was an earlier issue (404 Errors when loading the built app) related to this and it looks to be persisting. I can get around the errors by manually uncommenting the following line in buildOutput\app\env.js:

//apiUrl = './arcgis-js-api';

Should this already be taken care of by esri-wab-build, or at least documented on the readme?

There are additional errors once env.js is modified:

dojo.js:22 GET https://localhost/esri-wab-build/arcgis-js-api/esri/geometry/support/pe-wasm.js?wab_dv=2.11 net::ERR_ABORTED 404 AbsolutePositionLayoutManager.js?wab_dv=2.11:4 Load widgetOnScreen: 648.35009765625ms worker-init.js:29 failed to load resource (https://localhost/esri-wab-build/arcgis-js-api/esri/config.js) worker-init.js:29 DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://localhost/esri-wab-build/arcgis-js-api/esri/config.js' failed to load.

The build process didn't include the geometry or config packages in ..\buildOutput\app\arcgis-js-api.

lwuersch commented 5 years ago

I had the same initial error like you and for me it worked to just replace apiUrl = null at the beginning of env.js with the link to the api version (for example apiUrl = 'https://js.arcgis.com/3.27/'). I did not uncomment //apiUrl = './arcgis-js-api';

mlewis22 commented 5 years ago

I can also add that the esri/geometry is not copied over

\app\arcgis-js-api\esri\geometry - is missing.

Manual Work Around - Manually copy it from the build-src folder.

Looks like an addition property is required in the utilscripts.js docopy(path.join(from, "esri/geometry"), path.join(to, "arcgis-js-api/esri/geometry")); docopy(path.join(from, "esri/geometry/support"), path.join(to, "arcgis-js-api/esri/geometry/support"));

If i get round to it ill add a pull request asap.