Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df5d1aad48 | |||
| a6588818b5 |
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.6.5](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.4...v1.6.5) (2026-03-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* error koneksi Prisma - DATABASE_URL tidak loaded di ([a658881](https://wibugit.wibudev.com/wibu/hipmi/commit/a6588818b5d8018b3a634e0ae0846e309569d370))
|
||||||
|
|
||||||
## [1.6.4](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.3...v1.6.4) (2026-03-03)
|
## [1.6.4](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.3...v1.6.4) (2026-03-03)
|
||||||
|
|
||||||
## [1.6.3](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.2...v1.6.3) (2026-03-03)
|
## [1.6.3](https://wibugit.wibudev.com/wibu/hipmi/compare/v1.6.2...v1.6.3) (2026-03-03)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hipmi",
|
"name": "hipmi",
|
||||||
"version": "1.6.4",
|
"version": "1.6.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"prisma": {
|
"prisma": {
|
||||||
"seed": "bun prisma/seed.ts"
|
"seed": "bun prisma/seed.ts"
|
||||||
|
|||||||
@@ -38,4 +38,27 @@ if (fs.existsSync(prismaClientSrc)) {
|
|||||||
console.warn('⚠ @prisma/client not found, skipping...');
|
console.warn('⚠ @prisma/client not found, skipping...');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy .env file jika ada (untuk production)
|
||||||
|
const envSrc = path.join(__dirname, '../.env');
|
||||||
|
const envDest = path.join(standaloneDir, '.env');
|
||||||
|
if (fs.existsSync(envSrc)) {
|
||||||
|
fs.copyFileSync(envSrc, envDest);
|
||||||
|
console.log('✓ .env file copied to standalone output');
|
||||||
|
} else {
|
||||||
|
console.warn('⚠ .env file not found, skipping...');
|
||||||
|
console.warn(' Pastikan DATABASE_URL di-set di system environment server!');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy .env-local file jika ada (opsional)
|
||||||
|
const envLocalSrc = path.join(__dirname, '../.env-local');
|
||||||
|
const envLocalDest = path.join(standaloneDir, '.env-local');
|
||||||
|
if (fs.existsSync(envLocalSrc)) {
|
||||||
|
fs.copyFileSync(envLocalSrc, envLocalDest);
|
||||||
|
console.log('✓ .env-local file copied to standalone output');
|
||||||
|
}
|
||||||
|
|
||||||
console.log('✅ Postbuild script completed!');
|
console.log('✅ Postbuild script completed!');
|
||||||
|
console.log('');
|
||||||
|
console.log('📋 Penting untuk Production:');
|
||||||
|
console.log(' - Pastikan DATABASE_URL tersedia di environment server, ATAU');
|
||||||
|
console.log(' - File .env sudah ter-copy ke /app/.env di server');
|
||||||
|
|||||||
@@ -8,6 +8,24 @@ declare global {
|
|||||||
|
|
||||||
let prisma: PrismaClient;
|
let prisma: PrismaClient;
|
||||||
|
|
||||||
|
// Validasi DATABASE_URL sebelum inisialisasi
|
||||||
|
if (!process.env.DATABASE_URL) {
|
||||||
|
console.error('❌ ERROR: DATABASE_URL tidak ditemukan di environment variables!');
|
||||||
|
console.error('');
|
||||||
|
console.error('Current working directory:', process.cwd());
|
||||||
|
console.error('Available environment variables:', Object.keys(process.env).sort().join(', '));
|
||||||
|
console.error('');
|
||||||
|
console.error('Solusi:');
|
||||||
|
console.error(' 1. Pastikan file .env ada dan berisi DATABASE_URL, ATAU');
|
||||||
|
console.error(' 2. Set DATABASE_URL di system environment:');
|
||||||
|
console.error(' export DATABASE_URL="postgresql://user:pass@host:port/dbname"');
|
||||||
|
console.error(' 3. Jika menggunakan systemd service, tambahkan di file service:');
|
||||||
|
console.error(' [Service]');
|
||||||
|
console.error(' Environment=DATABASE_URL=postgresql://...');
|
||||||
|
console.error('');
|
||||||
|
throw new Error('DATABASE_URL is required but not found in environment variables');
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "production") {
|
if (process.env.NODE_ENV === "production") {
|
||||||
prisma = new PrismaClient({
|
prisma = new PrismaClient({
|
||||||
// Reduce logging in production to improve performance
|
// Reduce logging in production to improve performance
|
||||||
|
|||||||
Reference in New Issue
Block a user