Trying to get this to work: Package used to build ESRI Web App Builder Apps for production.

1903
18
03-11-2019 02:45 PM
IanPeebles
Occasional Contributor III

I am trying to get this package to work, but having difficulties getting started.  I found out a new way on how improve the performance of WAB applications.  I was referred to this documentation:

https://github.com/gbochenek/esri-wab-build/

I see the steps to follow, but not able to get these commands to run in command prompt.  Which command prompt should I be using?

Are there any screenshots that somebody can provide, so I can follow along?

Would love to give this a try

My web app builder is installed at: C:\GIS\arcgis-web-appbuilder-2.11\WebAppBuilderForArcGIS

Any help will greatly be appreciated.

Tags (1)
18 Replies
IanPeebles
Occasional Contributor III

Alright, I decided to re-install nodejs to make sure everything is OK.  So, starting from step #1:

1.  Navigate to the application to be built

2. Create a  project.json file (if one does not exist): npm init

So now where do I go from here?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ian,

  If you are unsure what it is asking then just press enter.

0 Kudos
IanPeebles
Occasional Contributor III

Robert, thank you much for your extensive help.  I am getting further as I was able to create the package.json file through the nodejs command prompt.

I am here:

  1. Add the following to your package.json's scripts object "build": "esri-wab-build" (Note: an optional parameter can be added to build a remote web app builder app. For Example: "esri-wab-build C:\arcgis-web-appbuilder-2.7\WebAppBuilderForArcGIS\server\apps\3")

When I open the package.json file, I have the following block of code:

I add "build": "esri-wab-build" to this block?  I tried that, then tried to run"

npm install

npm run build

That created the dist folder, but no builtOut folder within.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

 Add to package.json's scripts object. so it looks something like this:

{
  "name": "pv28",
  "version": "1.0.0",
  "description": "WAB site build",
  "main": "env.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "esri-wab-build"
  },
  "keywords": [
    "Build"
  ],
  "author": "Me",
  "license": "None",
  "devDependencies": {
    "esri-wab-build": "^1.1.0"
  }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
IanPeebles
Occasional Contributor III

Robert, I was able to get the script to run and create the build.  The zip file was created, then I extracted to an application directory on the server.  When launching the application, it just hangs and there are errors in console mode.  Really not sure where to go from here.  Here are some screenshots:

1. NodeJS Completed Script in Command Prompt

2. Files Created in Application Directory (On Local Machine)

3. Streamlined Application File Structure Following the Extract from the app.zip file

4. Trying to load the application following the extract of the files:

I am further compared to where I was, but still no results.

My workflow is pretty simple:

1. I created the applications on my local machine, customize it as needed, and add in custom widgets.

2. Following the creation of the application, I deploy to a server and it works

This build process is not really intuitive.  It would be nice to have some screenshots in prepping the dependencies and etc.  I am sure it is a nice utility when it runs.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ian,

   The buildOutput folder has an app folder and an app.zip in it right? For me the app.zip is normally corrupt when opening in WinZip so I always just copy the contents of the "buildOutput \app" folder over to my web server.

0 Kudos
IanPeebles
Occasional Contributor III

Robert, there is a folder named app within the buildOutput folder.  Here is a preview:

I then copied the contents to the app folder.  When launching, it still fails to load, but I seem some interesting errors in console mode.  Looks like a referencing issue?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ian,

   The double reference to your machine name looks like a IIS deploy issue with the website.

0 Kudos
MichelleN
New Contributor

Hi Ian, 

     Did you ever figure out what the issue was? I have the exact same errors with the duplicate reference to the machine. 

--Actually scratch that question.  I was able to remove those errors in the init.js by changing the paths from window.apiURL to just window.url and concatenating the "arcgis-js-api" .  

However,  although those errors disappeared post, I am still getting a loading error.  It's coming from the same file: init.js 201.  

Have you or anyone else come across this problem? Did I break it by manually changing init.js? 

Michelle

0 Kudos