Select to view content in your preferred language

Anyone tried Building Viewer and got it working?

533
3
Jump to solution
06-02-2022 06:01 PM
FrankOuyang
Esri Contributor

Has anyone tried/used building viewer before and have a functional copy? I cloned the repo from GitHub but can't get it running on my machine. When I run "npm run build", a large amount of error message were generated. Since I am not an expert on JS, I am not very sure how to fix them. I also tried update the module with "npm audit fix" but still no luck in getting it working.

 Any help or thoughts on this will be highly appreciated. 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor II

That project is pretty old, but you could bandaid it into shape with these changes.

--- a/package.json
+++ b/package.json
@@ -32,11 +32,13 @@
     "grunt-run": "^0.8.1",
     "grunt-stripcomments": "^0.7.2",
     "js-yaml": ">=3.13.1",
+    "sass": "^1.52.2",
+    "tslib": "^2.4.0",
     "tslint": "^4.2.0"
   },
   "dependencies": {
+    "@types/arcgis-js-api": "^4.20.0",
     "@types/dojo": "1.9.41",
-    "node-sass": "4.14.1",
     "typescript": "4.2.4"
   }
 }
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,8 +19,8 @@
     "baseUrl": ".",
     "moduleResolution": "node",
     "types": [ 
-      "dojo",
-      "./typings/arcgis-js-api-4.20"
+      "arcgis-js-api",
+      "dojo"
     ]
   },
   "include": [

 

View solution in original post

3 Replies
ReneRubalcava
Frequent Contributor II

That project is pretty old, but you could bandaid it into shape with these changes.

--- a/package.json
+++ b/package.json
@@ -32,11 +32,13 @@
     "grunt-run": "^0.8.1",
     "grunt-stripcomments": "^0.7.2",
     "js-yaml": ">=3.13.1",
+    "sass": "^1.52.2",
+    "tslib": "^2.4.0",
     "tslint": "^4.2.0"
   },
   "dependencies": {
+    "@types/arcgis-js-api": "^4.20.0",
     "@types/dojo": "1.9.41",
-    "node-sass": "4.14.1",
     "typescript": "4.2.4"
   }
 }
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -19,8 +19,8 @@
     "baseUrl": ".",
     "moduleResolution": "node",
     "types": [ 
-      "dojo",
-      "./typings/arcgis-js-api-4.20"
+      "arcgis-js-api",
+      "dojo"
     ]
   },
   "include": [

 

FrankOuyang
Esri Contributor

Thank you very much for the answer @ReneRubalcava and it works! I also add the following change to remove an error. Just out of curiosity, how do you figure all these changes out? I tried manipulated all these versioning before but not successful. Thanks again for your kind help.

FrankOuyang_1-1654489292433.png

 

0 Kudos
ReneRubalcava
Frequent Contributor II

When I did the npm install, I had a node-gyp error for node-sass I'm familiar with, so I knew that was a deprecated module and to replace it with regular sass. I also thought it was odd that the arcgis-js-api typings weren't installed, as this an older style TS to AMD build, so those were needed. Basically, I've been there, ha.