Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Using $env with SvelteKit and Docker

$
0
0

SvelteKit provides a good and easy way to use ENV variables:

https://learn.svelte.dev/tutorial/env-static-public

Im using Docker in a CI pipeline to create images. However when running RUN npm run build in the Dockerfile this leads to the TypeScript error described here: Sveltekit + Typescript: Environment variables build error.

The solution provided in the related answer (i.e. running svelte-kit sync) is not possible, since in the CI pipeline there is no ENV file during build. Therefore it won't find the variable and the build fails with the error above.

Is there another solution to do this?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>