FAQs
Netlify build fails with "Exposed Secrets Detected".
Netlify has a security feature that scans your code for potential exposed secrets, such as API keys or tokens. However, it wrongly identifies some environment variables as exposed secrets, leading to build failures. For example, If you store secret having value "production" in an environment variable, and if you write "production" anywhere in your code, Netlify will flag it as an exposed secret.
To avoid this, You can configure secret scanning behavior by adding following environment variables:
SECRETS_SCAN_ENABLED: Set this tofalseto disable secret scanning entirely. This is not recommended for production environments.SECRETS_SCAN_OMIT_KEYS: A comma-separated list of environment variable names that you want Netlify to ignore during secret scanning. For example, if you have an environment variable namedPOLAR_SERVER, you can add it to this list.SECRETS_SCAN_OMIT_PATHS: A comma-separated list of file paths or directories that you want Netlify to exclude from secret scanning. For example, if you have a specific file or directory that contains false positives, you can add it to this list. It also accepts glob patterns.
Read more about it in official netlify docs.
Error: TypeError: Cannot read properties of undefined (reading 'reduce')
While working on project you may receive this error:
[vite] TypeError: Cannot read properties of undefined (reading 'reduce')
at optionMatcher (dotenv_config.js?v=5c48a3f0:485:28)
at dotenv_config.js?v=5c48a3f0:506:28
at dotenv_config.js?v=5c48a3f0:509:3
Once the reason can be your environment variable are leaked to client side by mistake. E.g. You may have used parsed env in database tables which gets imported by database schemas which are in shared context and you use these shared schema in one of your page or component.
How to apply migrations in production?
For security reasons, NuxtStart doesn't run migrations automatically in production on deployment because it may lead to unwanted events like migration get applied but application fails to start. Hence, We have GitHub workflow which you can manually run after successful deployment to apply migrations in production. You can find it in .github/workflows/manual-db-migration.yml file. You can trigger this workflow from "Actions" tab of your GitHub repository.

