Skip to main content
Anchor to EnvironmentVariablesUserErrorCode

EnvironmentVariablesUserErrorCode

enum

Possible error codes that can be returned by EnvironmentVariablesUserError.

Anchor to CANT_MODIFY_READ_ONLY_ENVIRONMENT_VARIABLECANT_MODIFY_READ_ONLY_ENVIRONMENT_VARIABLE

A read-only environment variable can't be modified.

Anchor to CANT_REVEAL_SECRET_VARIABLESCANT_REVEAL_SECRET_VARIABLES

You can't reveal secret variables.

Anchor to DUPLICATE_ENVIRONMENT_VARIABLE_KEY_FOR_ENVIRONMENTDUPLICATE_ENVIRONMENT_VARIABLE_KEY_FOR_ENVIRONMENT

You can't associate an environment to multiple environment variable values for the same key.

Anchor to DUPLICATE_ENVIRONMENT_VARIABLE_KEY_ON_CREATEDUPLICATE_ENVIRONMENT_VARIABLE_KEY_ON_CREATE

An environment variable with the same key already exists.

Anchor to DUPLICATE_ENVIRONMENT_VARIABLE_KEY_VALUEDUPLICATE_ENVIRONMENT_VARIABLE_KEY_VALUE

An environment variable with the provided key-value already exists.

Anchor to ENVIRONMENT_NOT_FOUNDENVIRONMENT_NOT_FOUND

The environment provided wasn't found.

Anchor to ENVIRONMENTS_NOT_FOUNDENVIRONMENTS_NOT_FOUND

The environments provided weren't found.

Anchor to MAXIMUM_ENVIRONMENT_VARIABLES_PER_ENVIRONMENTMAXIMUM_ENVIRONMENT_VARIABLES_PER_ENVIRONMENT

You've reached the maximum number of variables for one of your environments.

Anchor to STOREFRONT_DISCONNECTEDSTOREFRONT_DISCONNECTED

Your storefront isn't connected to a GitHub repository.

Anchor to STOREFRONT_NOT_FOUNDSTOREFRONT_NOT_FOUND

The storefront was not found.

Anchor to UNASSIGNED_ENVIRONMENT_VARIABLE_VALUEUNASSIGNED_ENVIRONMENT_VARIABLE_VALUE

An environment variable is not assigned to any environment.

Anchor to USER_INPUT_MUST_UPDATE_VARIABLES_WITH_THE_SAME_KEYUSER_INPUT_MUST_UPDATE_VARIABLES_WITH_THE_SAME_KEY

The input updates environment variables with different keys.


Was this section helpful?

•OBJECT

Catches validation problems when you're setting up environment variables for your Hydrogen storefronts. When something goes wrong with your variable configuration, these errors tell you exactly what needs fixing so you can get your storefront running smoothly.

For example, when setting an invalid environment variable name or value that conflicts with system requirements, this error type captures the specific field and validation message to guide resolution.

Use EnvironmentVariablesUserError to:

  • Handle environment variable validation failures
  • Display specific error messages to developers
  • Identify which fields need correction
  • Provide clear feedback during storefront configuration

Each error includes the problematic field name and a descriptive message explaining the validation requirement that wasn't met.

Learn more about Hydrogen storefront configuration.


Was this section helpful?