Nuxt 3 static environment variables not loading

I’m using nuxt 3, my environment variables are defined inside Cleavr, but they are not being shown in the live app, this is working fine in my local environment.

In the docs: NodeJS Deployments Troubleshooting - Cleavr docs there is mention of the PM2 settings, however I can’t seem to find those.

Any idea how I can get the environment variables that I entered in Cleavr to be read by my Nuxt 3 static?

Hello @miguelst,

First of all, welcome to Cleavr Forum!

PM2 is not required for any static applications such as Nuxt3 Static, which is why you were unable to find the PM2 option on the Deployment Workflow page.

Nuxt has its own way of reading configuration, and you are likely already familiar with it (Runtime Config · Nuxt Advanced). It appears that the Nuxt Static app does not read configurations in a straightforward way.

We’ll see how we can help you with this matter.

Hello @miguelst,

We have identified that the Link Env was not enabled for your Nuxt Static application. We have enabled the hook and re-ordered it to run before the Generate App hook. We kindly ask that you verify it once and provide us with feedback on the results.

For your reference, please note that the Link Env hook is disabled by default for any static applications. In such cases, you’ll have to enable it by going to Deployments > Deployment Workflow > Deployment Hooks.

Thanks Anish! Much appreciated!

1 Like