acmcsuf.com icon indicating copy to clipboard operation
acmcsuf.com copied to clipboard

`npm run all` checks imply failure (status code 1) for non-env-holding users

Open amyipdev opened this issue 1 year ago • 6 comments

What happened?

When running npm run all, svelte-check yields 5 errors due to not having specific environment-variable secrets. While this is reasonable when running on-server, for development, this is unnecessary, and may confuse newer developers.

Recommendation: "soft fail" on environment variable-related svelte-check arguments.

amyipdev avatar Feb 21 '24 03:02 amyipdev

Note: I am aware that the contributor's guide recommends users set up their .env, however my point still stands that these should be warnings, not hard failures. GCAL_API_KEY also fails and is not mentioned in the contributor guide.

amyipdev avatar Feb 21 '24 03:02 amyipdev

and may confuse newer developers

I agree with the sentiment of this issue. Thanks for reporting 👍

EthanThatOneKid avatar Feb 21 '24 07:02 EthanThatOneKid

While this is a limitation of SvelteKit's environment variable handling, there's a workaround. SvelteKit restricts environment variables to client-side, server-side, or both for security reasons.

As a temporary solution, you can copy all necessary variables from .env.example to .env. Just use empty strings ("") as placeholders for the missing values.

For more details on SvelteKit's environment variables, refer to the documentation: https://learn.svelte.dev/tutorial/env-dynamic-private.

EthanThatOneKid avatar Mar 15 '24 22:03 EthanThatOneKid

What about adding a note to the README about that?

amyipdev avatar Mar 16 '24 17:03 amyipdev

What about adding a note to the README about that?

The current instructions for setting up the .env file are in our CONTRIBUTING.md document. However, it's been a while since we've updated that section. Do you think it might need to be clearer or more detailed?

EthanThatOneKid avatar Mar 16 '24 20:03 EthanThatOneKid

Definitely, it needs to be updated - it does not meet the current requirements.

amyipdev avatar Mar 17 '24 00:03 amyipdev