Open dbouwman opened 4 years ago
(I believe related) I just tried running createSolution in Node (13.11.0) and get the following error. Looks like the uuidv4
library assumes a crypto
global which isn't a global by default (separate module)
(node:22166) UnhandledPromiseRejectionWarning: ReferenceError: crypto is not defined
at /Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-common/dist/node/libs/uuidv4.js:25:14
at String.replace (<anonymous>)
at Object.createPseudoGUID (/Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-common/dist/node/libs/uuidv4.js:22:23)
at _getDeploymentProperties (/Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-creator/dist/node/creator.js:277:103)
at /Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-creator/dist/node/creator.js:226:25
at new Promise (<anonymous>)
at _createSolutionItem (/Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-creator/dist/node/creator.js:217:12)
at /Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-creator/dist/node/creator.js:197:9
at new Promise (<anonymous>)
at _createSolutionFromItemIds (/Users/maxp8108/esridev/presentations/2020-epc-dev/demo-extend-arcgis/web-client/node_modules/@esri/solution-creator/dist/node/creator.js:195:12)
Got around this by specifying the deploy.id.<id>
tag, however FileReader API also causing issues in Node in blobToText
Currently a number of tests are not run in node because of how
Blob
andFile
objects are utilized. This also means that the entire library can not be used in Node, which blocks the creation of an api that executes the Solution deployment process... which is a long-term goal of the Hub Team.That said, rest-js and hub.js leverage patterns and external libraries to handle
Blob
'sHub.js pulls in
fetch-blob
and abstracts out blob in a_which-blob
helper as shown here: https://github.com/Esri/hub.js/blob/master/packages/common/src/resources/_which-blob/_which-blob.tsWe will need to look for a similar option for
File
- there isfile-api
, but it's not clear if that is designed for isomorphic libraries or not.