I've attached a model that ships with Vensim (I'm testing with it).
Running "sde generate --genhtml prod5.mdl", I get the following output. I'm confused by the reports of "has no subscripts", those variables have got subscripts.
sde generate --genhtml prod5.mdl
_average_orders[them] has no subscripts in vensimName
_average_orders[us] has no subscripts in vensimName
_capacity[them] has no subscripts in vensimName
_capacity[us] has no subscripts in vensimName
/Users/TK421/prod5/model/build/prod5.c:367:21: error: use of undeclared identifier 'them'
&_capacity_life[them],
^
/Users/TK421/prod5/model/build/prod5.c:368:21: error: use of undeclared identifier 'us'
&_capacity_life[us],
^
/Users/TK421/prod5/model/build/prod5.c:369:31: error: use of undeclared identifier 'them'
&_time_to_adjust_capacity[them],
^
/Users/TK421/prod5/model/build/prod5.c:370:31: error: use of undeclared identifier 'us'
&_time_to_adjust_capacity[us],
^
/Users/TK421/prod5/model/build/prod5.c:371:30: error: use of undeclared identifier 'them'
&_time_to_average_orders[them],
^
/Users/TK421/prod5/model/build/prod5.c:372:30: error: use of undeclared identifier 'us'
&_time_to_average_orders[us],
^
/Users/TK421/prod5/model/build/prod5.c:393:29: error: use of undeclared identifier 'them'
outputVar(_average_orders[them]);
^
/Users/TK421/prod5/model/build/prod5.c:394:29: error: use of undeclared identifier 'us'
outputVar(_average_orders[us]);
^
/Users/TK421/prod5/model/build/prod5.c:395:23: error: use of undeclared identifier 'them'
outputVar(_capacity[them]);
^
/Users/TK421/prod5/model/build/prod5.c:396:23: error: use of undeclared identifier 'us'
outputVar(_capacity[us]);
^
10 errors generated.
Some more info, I think this is related to graphs.csv. If I replace the variables listed in the graphs.csv file with "time" only get one error (which I can solve easily),
"cp: no such file or directory: /Users/tony/OneDrive/Work/VSUK/Companies/V/Ventana_Systems_UK/SDEverywhere/prod5/model/logo.png"
I made a few changes to the model to avoid subscripts, and everything now seems to build (no output messages). But when visiting the resulting website, I get a white screen with two white squares (I think these should be the graphs).
I was able to get the original model with subscripts working by fixing a few things in the config files. I agree that the error messages did not help much. I'm using SDEverywhere version 0.5.1, which was just published to npm with a few recent enhancements and fixes.
Change the initial view in app.csv to "Models > PROD5" to match the view name in views.csv. This is why the graphs came up blank before.
Use numeric subscripts in sliders.csv instead of subscript names.
Use numeric subscripts in graphs.csv instead of subscript names. I also adjusted the graph x and y axis ranges to match the model data.
BTW if you haven't discovered this yet, the CSV files are much easier to work with in Excel if you open them from the Finder or File Explorer instead of from Excel. This avoids the Text Import Wizard.
(node:1196) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'trim' of undefined
at canonicalName (/usr/local/lib/node_modules/sdeverywhere/src/Helpers.js:31:8)
at /usr/local/lib/node_modules/sdeverywhere/src/MakeConfig.js:68:41
at _map (/usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/internal/_map.js:6:19)
at map (/usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/map.js:64:14)
at /usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/internal/_dispatchable.js:41:15
at Object.f2 [as map] (/usr/local/lib/node_modules/sdeverywhere/node_modules/ramda/src/internal/_curry2.js:29:14)
at getVarNames (/usr/local/lib/node_modules/sdeverywhere/src/MakeConfig.js:68:29)
at initConfig (/usr/local/lib/node_modules/sdeverywhere/src/MakeConfig.js:32:3)
at generate (/usr/local/lib/node_modules/sdeverywhere/src/sde-generate.js:85:5)
at Object.handler (/usr/local/lib/node_modules/sdeverywhere/src/sde-generate.js:71:3)
(node:1196) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1196) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The way I would approach that problem is to run SDEverywhere in a debugger using your particular model and spec files. If you can post them I can take a look.
Yes, please use SDEverywhere 0.5.1 henceforth. It's also possible I will fix problems in between releases that you would need to get from the develop branch of the GitHub repo. The README shows how to get the development version of SDEverywhere.
And yes, it's also necessary to use a local web server to serve the files. Previously, we could run local files in Firefox, but they recently disabled that capacity as a security feature. The README suggests a simple local server that can be used in development.