-
Is it still possible to set the HOST and ID from environment variables in runtimeConfig as shown in #39? Specifically set via env var when running a built server in production, no SSR. I'm running nuxt-umami v3.0.2. I've set up my [UMAMI]: Your API endpoint is missing or incorrectly configured. Check `host` & `customEndpoint` in module config.
[3qcYbTLZ.js:49:4735](http://localhost:3000/_nuxt/3qcYbTLZ.js)
Object { hostname: "localhost", language: "en-US", screen: "<redacted>", url: "<redacted>", referrer: "", title: "" }
[3qcYbTLZ.js:50:17](http://localhost:3000/_nuxt/3qcYbTLZ.js)
[UMAMI]: `id` is missing or incorrectly configured. Check module config.
[3qcYbTLZ.js:49:4735](http://localhost:3000/_nuxt/3qcYbTLZ.js)
Object { hostname: "localhost", language: "en-US", screen: "<redacted>", url: "<redacted>", referrer: "", title: "" } // nuxt.config.ts
...
runtimeConfig: {
public: {
umamiHost: process.env.NUXT_PUBLIC_UMAMI_HOST,
umamiId: process.env.NUXT_PUBLIC_UMAMI_ID,
}
} I have other public runtimeConfig that is set from environment variables that works without issue. Originally posted by @elsell in #36 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @elsell. Nuxt Umami should automatically pick up Hope this helps. |
Beta Was this translation helpful? Give feedback.
Ah, I see the problem. The module inlines env variables (into
runtimeConfig
if proxy is enabled, else static file). And because Nuxt modules only run on build, the variables have to be present when you runnuxt build
.