mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix prisma postgres dotenv error
This commit is contained in:
5
.changeset/lucky-cats-ring.md
Normal file
5
.changeset/lucky-cats-ring.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix prisma config dotenv error
|
||||||
@@ -154,7 +154,7 @@ export default prisma;
|
|||||||
import type { ProjectConfig } from "../types";
|
import type { ProjectConfig } from "../types";
|
||||||
|
|
||||||
export async function setupPrismaPostgres(config: ProjectConfig) {
|
export async function setupPrismaPostgres(config: ProjectConfig) {
|
||||||
const { projectName, packageManager, projectDir } = config;
|
const { packageManager, projectDir } = config;
|
||||||
const serverDir = path.join(projectDir, "apps/server");
|
const serverDir = path.join(projectDir, "apps/server");
|
||||||
const s = spinner();
|
const s = spinner();
|
||||||
s.start("Setting up Prisma PostgreSQL");
|
s.start("Setting up Prisma PostgreSQL");
|
||||||
@@ -172,6 +172,11 @@ export async function setupPrismaPostgres(config: ProjectConfig) {
|
|||||||
log.success(
|
log.success(
|
||||||
pc.green("Prisma PostgreSQL database configured successfully!"),
|
pc.green("Prisma PostgreSQL database configured successfully!"),
|
||||||
);
|
);
|
||||||
|
log.info(
|
||||||
|
pc.cyan(
|
||||||
|
'NOTE: Make sure to uncomment `import "dotenv/config";` in `apps/server/src/prisma.config.ts` to load environment variables.',
|
||||||
|
),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
const fallbackSpinner = spinner();
|
const fallbackSpinner = spinner();
|
||||||
fallbackSpinner.start("Setting up fallback configuration");
|
fallbackSpinner.start("Setting up fallback configuration");
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "dotenv/config";
|
// import "dotenv/config"; uncomment this to load .env
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import type { PrismaConfig } from "prisma";
|
import type { PrismaConfig } from "prisma";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user