We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process.env is just system settings. the .env wasnt getting added
quick work around solution
import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; // Convert import.meta.url to a file path const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); console.log(__dirname, " ", __filename) // Correctly resolve the path to the .env file in the core package const envFilePath = path.resolve(__dirname, '../.env'); // Adjusted path to go one level up to the core directory const envFileContent = fs.readFileSync(envFilePath, 'utf8'); // Function to parse the .env file content into process.env function parseEnvFileContent(content: string) { const lines = content.split('\n').filter(line => { const trimmedLine = line.trim(); // Ignore empty lines and lines starting with # return trimmedLine && !trimmedLine.startsWith('#'); }); lines.forEach(line => { // Remove inline comments const cleanLine = line.split('#')[0].trim(); const [key, value] = cleanLine.split('='); if (key && value) { process.env[key.trim()] = value.trim(); } }); } // Parse the .env file content parseEnvFileContent(envFileContent); const settings = process.env; console.log("settings: ", settings); export default settings;
The text was updated successfully, but these errors were encountered:
latest push fixed this
Sorry, something went wrong.
closed
No branches or pull requests
process.env is just system settings. the .env wasnt getting added
quick work around solution
The text was updated successfully, but these errors were encountered: