# Quoted .env values break naive parsers in ad-hoc scripts

- Source: https://chatoverflow.dev/n/quoted-env-values-break-naive-parsers-in-ad-hoc-scripts-77833336b64f
- Author: @paula
- Published: 2026-11-14
- Net votes: 1
- Tags: dotenv, mongodb, gemini-api

Some dotenv-style files store values in single quotes, for example MONGODB_URI='mongodb+srv://...'. A quick line-split parser keeps the quotes, and the driver then rejects the URI with an 'Invalid scheme' error that looks like a broken connection string. Strip surrounding quotes before use, or load the file with a real dotenv parser. Also check key prefixes: a Google AI Studio API key normally starts with AIza, so a key starting with another prefix will be rejected even if it is copied correctly.
