0

I followed the steps per listed on their website, but my VS Code threw the following error, and when I went to the localhost it appeared as such (with no where to upload my own .rvt files)

  • Reference Application Local Host enter image description here

  • VS Code error message enter image description here

Note: I fixed the directory to look like this, but it still isn't showing me the upload portal to include my own .RVT file. Updated VS Code .env

  • The VSCode error seems related to the folder location. You have folders `/testNumber5/forge-dataviz-iot-reference-app ` and you are running the command in `testNumber5` folder which is not a NodeJS app (no package.json). Maybe try to change directory to `forge-dataviz-iot-reference-app` – AlexAR Jun 28 '22 at 10:20
  • Another issue: It should be `.env` file, not `env_template.env` – Eason Kang Jun 29 '22 at 04:18
  • @EasonKang I think the reason the tutorial says to do env_template.env is because env_template already exists, so you're just turning it into a .env file – Wes Hinchman Jun 29 '22 at 07:07
  • @AlexAR You said I don't have a package.json but I think that I do, No? look on the left side of second image . ty – Wes Hinchman Jun 29 '22 at 07:09
  • I think Alex is saying you need to change the current directory from `testNumber5` to `testNumber5/forge-dataviz-iot-reference-app` by type `cd orge-dataviz-iot-reference-app` in the terminal, since your `package.json` is under `testNumber5/forge-dataviz-iot-reference-app`, but you executed `npm` under `testNumber5` – Eason Kang Jun 29 '22 at 07:36
  • From our [tutorial](https://forge.autodesk.com/en/docs/dataviz/v1/developers_guide/quickstart/replace_model/), I saw `> copy .\server\env_template .\server\.env`. It means copy `env_template` to `.env` file. Or you can just rename `env_template` to `.env`. See https://i.stack.imgur.com/2Amec.png – Eason Kang Jun 29 '22 at 07:38
  • @EasonKang I finally got everything to compile, but when I opened up localhost:9000/upload it looked the same as the original reference application? Has this happened to you, shouldn't it instead asl you to browse files to upload? – Wes Hinchman Jun 29 '22 at 07:51
  • No... unfortunately, please try to use vscode's debugger to check if your configurations in `.env` are used in the app. Here is the launch.json for this project: https://github.com/yiskang/forge-dataviz-iot-reference-app/blob/json-db/.vscode/launch.json – Eason Kang Jun 29 '22 at 08:07
  • Or you can just use other tools to complete the translation job, for example: https://marketplace.visualstudio.com/items?itemName=petrbroz.vscode-forge-tools and click the `translation (custom)` to submit the job with the master viewed request. – Eason Kang Jun 29 '22 at 08:09
  • Afterward, add your urn to FORGE_DOC_URN inside `.env` file, and then rerun npm run dev. See https://forge.autodesk.com/en/docs/dataviz/v1/developers_guide/quickstart/replace_model/ – Eason Kang Jun 29 '22 at 08:13
  • Where can the FORGE_DOC_URN be found? Also, every time I try to use that launch.json , VS Code has asked me to install a different type of extension @EasonKang – Wes Hinchman Jun 29 '22 at 09:29
  • These are some of the error messages that are being thrown, @EasonKang[2] events.js:377 [2] throw er; // Unhandled 'error' event [2] ^ [2] [2] Error: listen EADDRINUSE: address already in use :::9000 [2] at Server.setupListenHandle [as _listen2] (net.js:1331:16) [2] at listenInCluster (net.js:1379:12) [2] at Server.listen (net.js:1465:7) – Wes Hinchman Jun 29 '22 at 09:42
  • That means you have run the app by typing npm or other ways. please stop it before starting vscode debugger... – Eason Kang Jun 29 '22 at 10:03
  • @EasonKang alright I killed all of the ports, and that error isn't showing up anymore. But, I still am only seeing the regular reference application and not the upload one. do you know why this may be? – Wes Hinchman Jun 29 '22 at 10:16
  • @EasonKang I believe it is a problem with my 'FORGE_BUCKET=' but I am unsure of what a fitting one might be, i.e. whether to include http:// , whether to not include spaces, etc. – Wes Hinchman Jun 29 '22 at 11:21

1 Answers1

0

I was following the directions exactly as they were laid out on the Forge Data Visualization Reference Application introduction, and it wasn't giving me the result that I needed and it didn't allow me to upload my own model. I tried to do these steps through the Mac OS Monterey Terminal as well as through the VS Code Terminal dozens of times with slightly different changes each time, and none of these worked. So instead, I downloaded iTerm2 and tried again, and it worked PERFECTLY!