I am trying to setup playcanvas-sync, ultimately with TypeScript and hot swapping.
My steps so far:
cloned the playcanvas-sync repo and installed the npm package
set up the pcconfig file and the values seem to be processed correctly
created a pcignore.txt containing only ignore_all_textual_files
this is placed in an empty folder (where the PLAYCANVAS_TARGET_DIR points to) and the root in the Editor Assets
created a checkpoint containing this pcignore.txt file
Now for any pcwatch or pcsync command I try, I get the following error:
(node:15264) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'total' of undefined
at LoadAssets.callApi (...\PlayCanvas\src\load-assets.js:39:33)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async LoadAssets.run (...\PlayCanvas\src\load-assets.js:16:7)
at async AssetStore.populate (...\PlayCanvas\src\asset-store.js:23:26)
at async GetConfig.setStore (...\PlayCanvas\src\utils\get-config.js:44:25)
at async GetConfig.run (...\PlayCanvas\src\utils\get-config.js:21:5)
at async ComputeDiffAll.init (...\PlayCanvas\src\sync-commands\compute-diff-all.js:48:17)
at async ComputeDiffAll.run (...\PlayCanvas\src\sync-commands\compute-diff-all.js:36:5)
at async Object.reportDiffAll (...\PlayCanvas\src\sync-commands\sync-utils.js:9:19)
at async Object.errorIfDifferent (...\PlayCanvas\src\sync-commands\sync-utils.js:113:19)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:15264) TypeError: Cannot read property 'total' of undefined
at LoadAssets.callApi (...\PlayCanvas\src\load-assets.js:39:33)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async LoadAssets.run (...\PlayCanvas\src\load-assets.js:16:7)
at async AssetStore.populate (...\PlayCanvas\src\asset-store.js:23:26)
at async GetConfig.setStore (...\PlayCanvas\src\utils\get-config.js:44:25)
at async GetConfig.run (...\PlayCanvas\src\utils\get-config.js:21:5)
at async ComputeDiffAll.init (...\PlayCanvas\src\sync-commands\compute-diff-all.js:48:17)
at async ComputeDiffAll.run (...\PlayCanvas\src\sync-commands\compute-diff-all.js:36:5)
at async Object.reportDiffAll (...\PlayCanvas\src\sync-commands\sync-utils.js:9:19)
at async Object.errorIfDifferent (...\PlayCanvas\src\sync-commands\sync-utils.js:113:19)
(node:15264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process w
ith a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
Any help is appreciated
I would also like to have a look at a project that uses this technology to see the folder structure and how everything is set up.
The pcignore.txt contains ignore_all_textual_files, so I guess everything that is represented in text form and not binary.
Or do you mean what kind of files we have in the Assets Folder? Scripts (.js), Models (.fbx), Materials, Templates, Fonts (.ttf), …
Or do you mean on my harddrive? There is currently only the cloned playcanvas-sync folder
Thank you very much, that was it!
I was using the access key from the Editor as described in the babel/typescript-template from whydoidoit and others. Since there is no description about it in the playcanvas-sync readme, I thought they are the same.
I suggest to add a hint to the readme.md, that you need to generate the API token in the account settings
Thanks Maybe I can provide the example project myself if everything is running in the end.
Now pcsync is working as it should. However, pcwatch only says Started and stays open (running in Git bash on Windows). When I change a file it does not get uploaded. When I then stop and restart pcwatch, it correctly detects the change with the corresponding error message pointing to pcsync.
I reinstalled Node.js / npm with node-gyp and everything, but that didn’t change anything. Any idea where and how I could start to debug this? Otherwise I guess I have no other choice than to push it manually.
What do yo mean with “for the moment”?
Please double check all paths in your config file, in particular capital letters should match exactly. You should be seeing edit events on windows, so most likely something is wrong with the way you’ve configured the tool. Please review the relevant sections of the readme file.
Sorry I had not updated the initial post, everything is now already setup as you described.
playcanvas-sync is cloned to a different folder than the target dir.
My home directory contains this .pcconfig file:
After a successfull pcsync pullAll, the target directory now also contains all script files from the project and pcsync pushAll also works.
I believe everything is correct, since pcsync is working fine. I also verified TARGET_DIR, API_KEY, BRANCH_ID, and PROJECT_ID by changing it to another value, in which case pcsync stopped working with a matching error message.
Moreover, pcwatch is starting and detects initial differences during startup, but it does not pick up any file changes while it is running.
Cool, that will be something for us to looking into. Could you post the node version you are using as well just incase there’s an issue between node version?