CMS Development

JBrake
Contributor | Elite Partner
Contributor | Elite Partner

Watcher Stops on Syntax Error

I am experiencing and issue with the CLI watcher.

If a file is saved and there are no errors it is fine, however if there is an error a somewhat long error report is spat out into the terminal and the watcher stops.  (too long to show example here)

 

It seams to happen on multi-line logic such as an if or foreach statement. Alternatively making a error on a single line the file will still upload on save rather than show an error,  E.G. setting a variable and not closing the {% properly will still upload...

 

 

{% set will_upload = true % }

 

 

Using the Auto-save feature in VSCode is out of the question while this is happening, but even on regular saving this will still slow down development significantly. I am human, I make mistakes.


In days past an abridged error would be output to the terminal, but the watcher would not stop, so correcting the issue and saving uploads the file. E.G.

 

[ERROR] Uploading file /Users/*/*/*/theme/modules/*/*.module/module.html to theme/modules/*/*.module/module.html failed
[ERROR] internal error
[ERROR] line 118: Syntax error in '{% endfor %}': Mismatched end tag, expected: endif
[ERROR] 'hubdb_table' is required but no default is set


Has anyone else found this? Manage to resolve. This is a new install,

I am using node v20.12.2, npm v9.8.1 and hs v5.2.0 with VSCode v1.88.1  on windows 11.  (a colleague is using hs v4.2.0 and its working as espected)

Regards,

Jonathan

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Watcher Stops on Syntax Error

Hey, @JBrake 👋 Thanks for your post. Can you open an issue over on the repo, please? You didn't do anything wrong by posting. The people who work on the CLI repo aren't very active on the community forums. We will definitely leave this open for suggestions from any of our community members. 

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
JBrake
Contributor | Elite Partner
Contributor | Elite Partner

Watcher Stops on Syntax Error

Thanks Jaycee, Have done.

https://github.com/HubSpot/hubspot-cli/issues/1048

I've also downgraded to v4.2.0 and the watcher is working as expected.

 

Jonathan

0 Upvotes