Hi, I successfully added a Sandbox connection to my hubspot.config.yml by using “npx hs auth”. I can now switch between production and sandbox, but when I ‘hs watch’ using the sandbox account, I get the following error:
[ERROR] Unable to load config from environment variables.
I’ve never created any kind of env variables myself, so I’m stumped what or where the error is referring to.
My changes are still geting uploaded to my sandbox when watching, but that error message persists and I can’t seem to understand why I’m getting it.
I’m using Node 16, but when I downgrade to Node 10 (out of curiosity), the error doesn’t appear.
Any thoughts?
Hi, @grandoompa
Thanks for reaching out. Let’s see if we can get things moving for you. Hey, @Gonzalo @Indra @LMeert, can you provide any help or tips on how to approach the error @grandoompa is experiencing?
Best,
Jaycee
Hi, @Jaycee_Lewis , I’m getting the same error after updating Hubspot CLI to 4.0.1. With 4.0.0, I don’t get any errors.
Any help would be appreciated.
Thank you.
I am experiencing the same thing. Any command in the CLI seams to generate the message (watch, fetch, list), though I’ve not found it stop anything I am trying to do, so… far… but it is a bit of a concern that I am getting it in any case.
I’m getting the same error on the production portal only. (not getting It on the sandbox account).
Different from you I’ve defined some env variables with the hs secrets command.
Not only watch or upload commands but any other hubspot CLI command that tries to connect with the portal produces the same error message like:
hs secrets list --account=
I’m looking for a solution too.
Thanks!
I tried something that fixed It for me.
I was getting the error only when I set the --account parameter.
So, in your hubspot.config.yml set the defaultPortal to the one you are working with at the moment you run ‘hs watch’ (sandbox or production).
Additionally you might change the defaultPortal with the command below:
hs accounts use <account_name>
I hope It helps you too.
Thanks!
Hi @RobertMarinho , Thank you very much for your input and suggestion. I appreciate it.
So when I tried either “hs accounts use SANDBOX”, which I see updates my hubspot.config.yml, or manually changed the defaultPortal to SANDBOX and then “hs watch”, it seems the first save while watching gets uploaded to the SANDBOX account, but then my hubspot.config.yml immediately reverts back to PROD after the save/upload - the first account listed in my hubspot.config.yml. Note: I’m trying to switch between “PROD” and “SANDBOX” accounts in my hubspot.config.yml.
So it seems that the change doesn’t stick. Did you encounter the same experience, by any chance?
Hi @grandoompa You’re welcome.
That’s an weird issue. I never experienced It.
Here are some options I would try in this case:
- Check if hubspot cli is updated to the most recent version.
- Recreate the hubspot.config.yml file again with hs auth.
- Try to separate the hubspot.config.yml in 2 files: hubspot.config.SANDBOX.yml and hubspot.config.PROD.yml. The run “hs watch” passing the option --config to the account you’re working at:
hs watch <src> <dest> --config=hubspot.config.SANDBOX.yml
Thank you!