HC Scaffolding - Automatic setup: there was an error executing the automatic setup, exiting

I am having some issues using the holochain scaffolding cli and web UI.

I am running on an M1 Mac Monterey v 12.5.1

I have nix shell installed, but when using the scaffolder on the cmd Automatic Setup: nix-shell . --run "npm install", I get the following logs after the copy operations:

building '/nix/store/lrkvxaplzzhgd8syy4aiqss96s4sg7z7-hn-introspect.drv'...
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated wrench@1.3.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
npm ERR! code 1
npm ERR! path /Users/checoelho/todo-app/ui
npm ERR! command failed
npm ERR! command sh -c npm run build
npm ERR! > ui@1.0.0 build
npm ERR! > rollup -c
npm ERR!
npm ERR! src/main.ts → public/build/bundle.js...
npm ERR! (!) `this` has been rewritten to `undefined`
npm ERR! https://rollupjs.org/guide/en/#error-this-is-undefined
npm ERR! ../node_modules/@type-craft/title/dist/definitions/create-title.js
npm ERR! 1: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
npm ERR!                      ^
npm ERR! 2:     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
npm ERR! 3:     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
npm ERR! ...and 1 other occurrence
npm ERR! ../node_modules/@type-craft/title/dist/definitions/title-detail.js
npm ERR! 1: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
npm ERR!                      ^
npm ERR! 2:     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
npm ERR! 3:     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
npm ERR! ...and 1 other occurrence
npm ERR! ../node_modules/@type-craft/date-time/dist/definitions/create-date-time.js
npm ERR! 1: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
npm ERR!                      ^
npm ERR! 2:     var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
npm ERR! 3:     if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
npm ERR! ...and 1 other occurrence
npm ERR!
npm ERR! ...and 15 other files
npm ERR! (!) Plugin replace: @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
npm ERR! (!) Plugin svelte: Unused CSS selector "h1"
npm ERR! src/App.svelte
npm ERR! 47:   }
npm ERR! 48:
npm ERR! 49:   h1 {
npm ERR!       ^
npm ERR! 50:     color: #ff3e00;
npm ERR! 51:     text-transform: uppercase;
npm ERR! [!] (plugin commonjs) SyntaxError: Unexpected keyword 'this' (170:11) in /Users/checoelho/todo-app/node_modules/@vaadin/field-base/src/helper-controller.js
npm ERR! ../node_modules/@vaadin/field-base/src/helper-controller.js (170:11)
npm ERR! 168:         detail: {
npm ERR! 169:           hasHelper,
npm ERR! 170:           node: this.node,
npm ERR!                 ^
npm ERR! 171:         },
npm ERR! 172:       }),
npm ERR! SyntaxError: Unexpected keyword 'this' (170:11) in /Users/checoelho/todo-app/node_modules/@vaadin/field-base/src/helper-controller.js
npm ERR!     at Parser.pp$4.raise (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:19551:13)
npm ERR!     at Parser.pp$5.checkUnreserved (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:19451:12)
npm ERR!     at Parser.pp$5.parsePropertyValue (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:19258:10)
npm ERR!     at Parser.pp$5.parseProperty (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:19221:8)
npm ERR!     at Parser.pp$5.parseObj (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:19167:21)
npm ERR!     at Parser.pp$5.parseExprAtom (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:18902:17)
npm ERR!     at Parser.pp$5.parseExprSubscripts (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:18718:19)
npm ERR!     at Parser.pp$5.parseMaybeUnary (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:18684:17)
npm ERR!     at Parser.pp$5.parseExprOps (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:18611:19)
npm ERR!     at Parser.pp$5.parseMaybeConditional (/Users/checoelho/todo-app/node_modules/rollup/dist/shared/rollup.js:18594:19)
npm ERR!
npm ERR! npm ERR! Lifecycle script `build` failed with error:
npm ERR! npm ERR! Error: command failed
npm ERR! npm ERR!   in workspace: ui@1.0.0
npm ERR! npm ERR!   at location: /Users/checoelho/todo-app/ui

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/checoelho/.npm/_logs/2022-09-25T00_39_15_318Z-debug-0.log
> Automatic setup: there was an error executing the automatic setup, exiting...
npm ERR! code 1
npm ERR! path /Users/checoelho
npm ERR! command failed
npm ERR! command sh -c create

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/checoelho/.npm/_logs/2022-09-25T00_34_33_224Z-debug-0.log

I have reinstalled holochain and nix to try and address this however it is not the source of the problem.

Any assistance with getting the UI to build would be greatly appreciated.

UPDATE:

The errors I was getting proved difficult to debug, but I noticed it works fine if I only use the default fields for the entry definition `{title: Title, content: Content}. As soon as I add an AgentPubKey and a Date and Time, I get the above error.

Thanks

1 Like

Is this the latest version of the scaffolding tool (0.0.41)? I was not able to reproduce it, but I remember there was a similar issue in one of the earlier versions. To make sure you get the latest version use the command npx @holochain/create@latest.

1 Like

Thanks @matthme, I appreciate the response. I definitley used the npx @holochain/create@latest command, so I assume my version was the latest.

I added an update to my question, with some more info on edge cases.

Thanks, @matthme, I appreciate you looking into this and opening a ticket.

I can definitely work around this for the time being.

Cheers