Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: TRIGGER_SECRET_KEY is being set to undefined when using Vite #1369

Open
Woolworths opened this issue Sep 28, 2024 · 2 comments
Open

bug: TRIGGER_SECRET_KEY is being set to undefined when using Vite #1369

Woolworths opened this issue Sep 28, 2024 · 2 comments

Comments

@Woolworths
Copy link

Woolworths commented Sep 28, 2024

Provide environment information

  System:
    OS: macOS 14.6.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 184.53 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.9.0 - /opt/homebrew/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.3 - /opt/homebrew/bin/npm
    pnpm: 9.11.0 - /opt/homebrew/bin/pnpm

Describe the bug

Somehow my TRIGGER_SECRET_KEY is not getting passed through when using Vite.

Running:
import { TRIGGER_SECRET_KEY, TRIGGER_SECRET_KEYY, TRIGGER_API_URL } from '$env/static/private';

I get undefined, tr_dev_xyz, http://127.0.0.1:3040 which is strange. If I call the secret key TRIGGER_SECRET_KEYY instead of TRIGGER_SECRET_KEY it passes through no problem. I've grepped my codebase and I'm not doing anything with this environment variable anywhere.

Reproduction repo

n/a

To reproduce

Using SvelteKit to trigger a task, and Vite to load up my .env file.

Additional information

No response

@perostlin
Copy link

A temporary work around is to use dotenv

// hooks.server.ts

import 'dotenv/config'

@ghostdevv
Copy link
Contributor

Do you have a reproduction available? @Woolworths I can take a look if so, as it's SvelteKit related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants