Repository navigation
Replies: 1 comment
|
That behavior is expected because the SvelteKit server and a Trigger task run in different runtimes. SvelteKit's $env modules are provided by the SvelteKit/Vite build and are not automatically available inside the Trigger worker. Inside the task, process.env comes from the Trigger environment (or the local .env used by the Trigger CLI), not from SvelteKit's env loader. Also, the question is using Trigger.dev v2 terminology. New v2 projects are no longer created, so the supported path is v3 or newer. For a v3 setup:
If you need SvelteKit functions inside tasks, the community vite-plugin-triggerkit package provides SvelteKit/Vite integration and hot reload. It does not replace Trigger's own task environment variables. References:
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
Does anyone have a project setup using SvelteKit + Trigger.dev v2?
I’m having some issues when triggering a task from a server endpoint, can’t use SvelteKit’s $env inside the task and process.env seem to take the values from my .env file.
Any ideas?💡
All reactions