mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
963 stars 243 forks source link

create-toolpad-app: add warning on missing configuration #3972

Closed Janpot closed 1 week ago

Janpot commented 1 month ago

Summary

We could add a warning, or even crash the program on missing required configuration.

Examples

e.g. User configures Google authentication but forgets to configure the variables. We could add something like the following in the auth.js file:

invariant(process.env.GOOGLE_CLIENT_ID, 'GOOGLE_CLIENT_ID is required. See https://mui.com/auth/google');
invariant(process.env.GOOGLE_CLIENT_SECRET, 'GOOGLE_CLIENT_SECRET is required. See https://mui.com/auth/google');

Motivation

Early warning when user tries to start a program that can't be accessed. Early fail when user tries to deploy without configuring these variables.

Search keywords: config warning

github-actions[bot] commented 1 week ago

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.