VITE_.. env now not being picked up after using wrangler.toml

I switched to using a wrangler.toml in the root of my cloudflare pages repo, and now all of a sudden I'm getting this message on build:
20:01:56.667 (!) %VITE_GA4_KEY% is not defined in env variables found in /index.html. Is the variable mistyped?
20:01:56.667 (!) %VITE_GA4_KEY% is not defined in env variables found in /index.html. Is the variable mistyped?
20:01:56.667 (!) %VITE_GA4_KEY% is not defined in env variables found in /index.html. Is the variable mistyped?
20:01:56.667 (!) %VITE_GA4_KEY% is not defined in env variables found in /index.html. Is the variable mistyped?
So, VITE_GA4_KEY is defined in my cloudflare settings as you can see here... I've never had this error until I started using the wrangler.toml file. I deploy using Github/Cloudflare integration on push. This is my wrangler.toml which is new. Again, I used to just push on Github and it would just autoconfigure everything, but it was using Node version 18 and I needed 20 and it said the only way to do that is to use a wrangler.toml
name = "my-page"
pages_build_output_dir = "dist"
compatibility_date = "2024-01-15"

[vars]
NODE_VERSION = "20.9.0"
name = "my-page"
pages_build_output_dir = "dist"
compatibility_date = "2024-01-15"

[vars]
NODE_VERSION = "20.9.0"
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?