baptisteArno / typebot.io

💬 Typebot is a powerful chatbot builder that you can self-host.
https://typebot.io
Other
7.34k stars 2.02k forks source link

Error: Prisma schema validation #573

Closed NghiaDangTran closed 1 year ago

NghiaDangTran commented 1 year ago

Hi guys i keep getting this error when I try run it on my windows machine

@typebot.io/prisma:db:generate: > @typebot.io/prisma@0.1.0 db:generate C:\Users\BoB Dang\Downloads\typebot.io-main\typebot.io-main\packages\prisma
@typebot.io/prisma:db:generate: > tsx scripts/db-generate.ts
@typebot.io/prisma:db:generate: 
@typebot.io/prisma:db:generate: Executing for PostgreSQL schema
@typebot.io/prisma:db:push: Executing for PostgreSQL schema
@typebot.io/prisma:db:generate: Command failed: prisma generate --schema C:\Users\BoB Dang\Downloads\typebot.io-main\typebot.io-main\packages\prisma\postgresql\schema.prisma
@typebot.io/prisma:db:generate: Error: Prisma schema validation - (get-config wasm)
@typebot.io/prisma:db:generate: Error code: P1012
@typebot.io/prisma:db:generate: error: Error validating: This line is invalid. It does not start with any known Prisma schema keyword.
@typebot.io/prisma:db:generate:   -->  schema.prisma:1
baptisteArno commented 1 year ago

What command are you running?

NghiaDangTran commented 1 year ago

thank for the quick reply, I run the same with the Local setup then I try the manual hosting but got the above message with pnpm run build:apps

baptisteArno commented 1 year ago

If you open the C:\Users\BoB Dang\Downloads\typebot.io-main\typebot.io-main\packages\prisma\postgresql\schema.prisma file. What's its content?

NghiaDangTran commented 1 year ago
generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider     = "mysql"
  url          = env("DATABASE_URL")
  relationMode = "prisma"
}

model Account {
  id                       String  @id @default(cuid())
  userId                   String
  type                     String
  provider                 String
  providerAccountId        String
  refresh_token            String? @db.Text
  access_token             String? @db.Text
  expires_at               Int?
  token_type               String?
  scope                    String?
  id_token                 String? @db.Text
  session_state            String?
  oauth_token_secret       String?
  oauth_token              String?
  refresh_token_expires_in Int?
  user                     User    @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([provider, providerAccountId])
  @@index([userId])
}

model Session {
  id           String   @id @default(cuid())
  sessionToken String   @unique
  userId       String
  expires      DateTime
  user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@index([userId])
}

model User {
  id                      String                    @id @default(cuid())
  createdAt               DateTime                  @default(now())
  updatedAt               DateTime                  @default(now()) @updatedAt
  lastActivityAt          DateTime                  @default(now())
  name                    String?                   @db.VarChar(255)
  email                   String?                   @unique
  emailVerified           DateTime?
  image                   String?                   @db.VarChar(1000)
  company                 String?
  onboardingCategories    Json
  graphNavigation         GraphNavigation?
  preferredAppAppearance  String?
  accounts                Account[]
  apiTokens               ApiToken[]
  CollaboratorsOnTypebots CollaboratorsOnTypebots[]
  workspaces              MemberInWorkspace[]
  sessions                Session[]
}

model ApiToken {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  token     String   @unique
  name      String
  ownerId   String
  owner     User     @relation(fields: [ownerId], references: [id], onDelete: Cascade)

  @@index([ownerId])
}

model Workspace {
  id                            String                @id @default(cuid())
  createdAt                     DateTime              @default(now())
  updatedAt                     DateTime              @default(now()) @updatedAt
  name                          String                @db.VarChar(255)
  icon                          String?               @db.VarChar(1000)
  plan                          Plan                  @default(FREE)
  stripeId                      String?               @unique
  credentials                   Credentials[]
  customDomains                 CustomDomain[]
  folders                       DashboardFolder[]
  members                       MemberInWorkspace[]
  typebots                      Typebot[]
  invitations                   WorkspaceInvitation[]
  additionalChatsIndex          Int                   @default(0)
  additionalStorageIndex        Int                   @default(0)
  chatsLimitFirstEmailSentAt    DateTime?
  storageLimitFirstEmailSentAt  DateTime?
  chatsLimitSecondEmailSentAt   DateTime?
  storageLimitSecondEmailSentAt DateTime?
  claimableCustomPlan           ClaimableCustomPlan?
  customChatsLimit              Int?
  customStorageLimit            Int?
  customSeatsLimit              Int?
  isQuarantined                 Boolean               @default(false)
  themeTemplates                ThemeTemplate[]
}

model MemberInWorkspace {
  createdAt   DateTime      @default(now())
  updatedAt   DateTime      @default(now()) @updatedAt
  userId      String
  workspaceId String
  role        WorkspaceRole
  user        User          @relation(fields: [userId], references: [id], onDelete: Cascade)
  workspace   Workspace     @relation(fields: [workspaceId], references: [id], onDelete: Cascade)

  @@unique([userId, workspaceId])
  @@index([workspaceId])
}

model WorkspaceInvitation {
  id          String        @id @default(cuid())
  createdAt   DateTime      @default(now())
  updatedAt   DateTime      @default(now()) @updatedAt
  email       String
  workspaceId String
  type        WorkspaceRole
  workspace   Workspace     @relation(fields: [workspaceId], references: [id], onDelete: Cascade)

  @@index([workspaceId])
}

model CustomDomain {
  name        String    @id @db.VarChar(255)
  createdAt   DateTime  @default(now())
  workspaceId String
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)

  @@index([workspaceId])
}

model Credentials {
  id          String    @id @default(cuid())
  createdAt   DateTime  @default(now())
  workspaceId String
  data        String    @db.Text
  name        String
  type        String
  iv          String
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)

  @@index([workspaceId])
}

model VerificationToken {
  identifier String
  token      String   @unique
  expires    DateTime

  @@unique([identifier, token])
}

model DashboardFolder {
  id             String            @id @default(cuid())
  createdAt      DateTime          @default(now())
  updatedAt      DateTime          @default(now()) @updatedAt
  name           String            @db.VarChar(255)
  parentFolderId String?
  workspaceId    String
  parentFolder   DashboardFolder?  @relation("ParentChild", fields: [parentFolderId], references: [id], onDelete: NoAction, onUpdate: NoAction)
  workspace      Workspace         @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  childrenFolder DashboardFolder[] @relation("ParentChild")
  typebots       Typebot[]

  @@index([workspaceId])
  @@index([parentFolderId])
}

model Typebot {
  id                      String                    @id @default(cuid())
  version                 String?                   @db.VarChar(10)
  createdAt               DateTime                  @default(now())
  updatedAt               DateTime                  @default(now()) @updatedAt
  icon                    String?                   @db.Text()
  name                    String                    @db.VarChar(255)
  folderId                String?
  groups                  Json
  variables               Json
  edges                   Json
  theme                   Json
  selectedThemeTemplateId String?
  settings                Json
  publicId                String?                   @unique
  customDomain            String?                   @unique
  workspaceId             String
  resultsTablePreferences Json?
  folder                  DashboardFolder?          @relation(fields: [folderId], references: [id])
  workspace               Workspace                 @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  collaborators           CollaboratorsOnTypebots[]
  invitations             Invitation[]
  publishedTypebot        PublicTypebot?
  results                 Result[]
  webhooks                Webhook[]
  isArchived              Boolean                   @default(false)
  isClosed                Boolean                   @default(false)

  @@index([workspaceId])
  @@index([folderId])
  @@index([isArchived, createdAt(sort: Desc)])
}

model Invitation {
  createdAt DateTime          @default(now())
  updatedAt DateTime          @default(now()) @updatedAt
  email     String
  typebotId String
  type      CollaborationType
  typebot   Typebot           @relation(fields: [typebotId], references: [id], onDelete: Cascade)

  @@unique([email, typebotId])
  @@index([typebotId])
}

model CollaboratorsOnTypebots {
  createdAt DateTime          @default(now())
  updatedAt DateTime          @default(now()) @updatedAt
  userId    String
  typebotId String
  type      CollaborationType
  typebot   Typebot           @relation(fields: [typebotId], references: [id], onDelete: Cascade)
  user      User              @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([userId, typebotId])
  @@index([typebotId])
}

model PublicTypebot {
  id        String   @id @default(cuid())
  version   String?  @db.VarChar(10)
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
  typebotId String   @unique
  groups    Json
  variables Json
  edges     Json
  theme     Json
  settings  Json
  typebot   Typebot  @relation(fields: [typebotId], references: [id], onDelete: Cascade)
}

model Result {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  typebotId   String
  variables   Json
  isCompleted Boolean
  hasStarted  Boolean?
  isArchived  Boolean? @default(false)
  typebot     Typebot  @relation(fields: [typebotId], references: [id], onDelete: Cascade)
  answers     Answer[]
  logs        Log[]

  @@index([typebotId, isArchived, hasStarted, createdAt(sort: Desc)])
  @@index([typebotId, isArchived, isCompleted])
}

model Log {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  resultId    String
  status      String
  description String   @db.Text
  details     String?  @db.Text
  result      Result   @relation(fields: [resultId], references: [id], onDelete: Cascade)

  @@index([resultId])
}

model Answer {
  createdAt   DateTime @default(now()) @updatedAt
  resultId    String
  blockId     String
  groupId     String
  variableId  String?
  content     String   @db.Text
  storageUsed Int?
  result      Result   @relation(fields: [resultId], references: [id], onDelete: Cascade)

  @@unique([resultId, blockId, groupId])
  @@index([groupId])
  @@index([storageUsed])
}

model Coupon {
  userPropertiesToUpdate Json
  code                   String    @id @unique
  dateRedeemed           DateTime?
}

model Webhook {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  updatedAt   DateTime @default(now()) @updatedAt
  url         String?  @db.VarChar(2000)
  method      String
  queryParams Json
  headers     Json
  body        String?  @db.Text
  typebotId   String
  typebot     Typebot  @relation(fields: [typebotId], references: [id], onDelete: Cascade)

  @@index([typebotId])
}

model ClaimableCustomPlan {
  id           String    @id @default(cuid())
  createdAt    DateTime  @default(now())
  claimedAt    DateTime?
  name         String
  description  String?
  price        Int
  currency     String
  workspaceId  String    @unique
  workspace    Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  chatsLimit   Int
  storageLimit Int
  seatsLimit   Int
  isYearly     Boolean   @default(false)
  companyName  String?
  vatType      String?
  vatValue     String?
}

model ChatSession {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
  state     Json
}

model ThemeTemplate {
  id          String    @id @default(cuid())
  createdAt   DateTime  @default(now())
  updatedAt   DateTime  @default(now()) @updatedAt
  name        String
  theme       Json
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  workspaceId String

  @@index([workspaceId])
}

enum WorkspaceRole {
  ADMIN
  MEMBER
  GUEST
}

enum GraphNavigation {
  MOUSE
  TRACKPAD
}

enum Plan {
  FREE
  STARTER
  PRO
  LIFETIME
  OFFERED
  CUSTOM
  UNLIMITED
}

enum CollaborationType {
  READ
  WRITE
  FULL_ACCESS
}
baptisteArno commented 1 year ago

Hum, are you sure it's packages\prisma\postgresql\schema.prisma? And not packages\prisma\mysql\schema.prisma?

NghiaDangTran commented 1 year ago

yeah that's my bad, it is this one (i dont even edit anything yet)

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model Account {
  id                       String  @id @default(cuid())
  userId                   String
  type                     String
  provider                 String
  providerAccountId        String
  refresh_token            String?
  access_token             String?
  expires_at               Int?
  token_type               String?
  scope                    String?
  id_token                 String?
  session_state            String?
  oauth_token_secret       String?
  oauth_token              String?
  refresh_token_expires_in Int?
  user                     User    @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([provider, providerAccountId])
}

model Session {
  id           String   @id @default(cuid())
  sessionToken String   @unique
  userId       String
  expires      DateTime
  user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model User {
  id                      String                    @id @default(cuid())
  createdAt               DateTime                  @default(now())
  updatedAt               DateTime                  @default(now()) @updatedAt
  lastActivityAt          DateTime                  @default(now())
  name                    String?
  email                   String?                   @unique
  emailVerified           DateTime?
  image                   String?
  company                 String?
  onboardingCategories    Json
  graphNavigation         GraphNavigation?
  preferredAppAppearance  String?
  accounts                Account[]
  apiTokens               ApiToken[]
  CollaboratorsOnTypebots CollaboratorsOnTypebots[]
  workspaces              MemberInWorkspace[]
  sessions                Session[]
}

model ApiToken {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  token     String   @unique
  name      String
  ownerId   String
  owner     User     @relation(fields: [ownerId], references: [id], onDelete: Cascade)
}

model Workspace {
  id                            String                @id @default(cuid())
  createdAt                     DateTime              @default(now())
  updatedAt                     DateTime              @default(now()) @updatedAt
  name                          String
  icon                          String?
  plan                          Plan                  @default(FREE)
  stripeId                      String?               @unique
  credentials                   Credentials[]
  customDomains                 CustomDomain[]
  folders                       DashboardFolder[]
  members                       MemberInWorkspace[]
  typebots                      Typebot[]
  invitations                   WorkspaceInvitation[]
  additionalChatsIndex          Int                   @default(0)
  additionalStorageIndex        Int                   @default(0)
  chatsLimitFirstEmailSentAt    DateTime?
  storageLimitFirstEmailSentAt  DateTime?
  chatsLimitSecondEmailSentAt   DateTime?
  storageLimitSecondEmailSentAt DateTime?
  claimableCustomPlan           ClaimableCustomPlan?
  customChatsLimit              Int?
  customStorageLimit            Int?
  customSeatsLimit              Int?
  isQuarantined                 Boolean               @default(false)
  themeTemplates                ThemeTemplate[]
}

model MemberInWorkspace {
  createdAt   DateTime      @default(now())
  updatedAt   DateTime      @default(now()) @updatedAt
  userId      String
  workspaceId String
  role        WorkspaceRole
  user        User          @relation(fields: [userId], references: [id], onDelete: Cascade)
  workspace   Workspace     @relation(fields: [workspaceId], references: [id], onDelete: Cascade)

  @@unique([userId, workspaceId])
}

model WorkspaceInvitation {
  id          String        @id @default(cuid())
  createdAt   DateTime      @default(now())
  updatedAt   DateTime      @default(now()) @updatedAt
  email       String
  workspaceId String
  type        WorkspaceRole
  workspace   Workspace     @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
}

model CustomDomain {
  name        String    @id
  createdAt   DateTime  @default(now())
  workspaceId String
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
}

model Credentials {
  id          String    @id @default(cuid())
  createdAt   DateTime  @default(now())
  workspaceId String
  data        String
  name        String
  type        String
  iv          String
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
}

model VerificationToken {
  identifier String
  token      String   @unique
  expires    DateTime

  @@unique([identifier, token])
}

model DashboardFolder {
  id             String            @id @default(cuid())
  createdAt      DateTime          @default(now())
  updatedAt      DateTime          @default(now()) @updatedAt
  name           String
  parentFolderId String?
  workspaceId    String
  parentFolder   DashboardFolder?  @relation("ParentChild", fields: [parentFolderId], references: [id])
  workspace      Workspace         @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  childrenFolder DashboardFolder[] @relation("ParentChild")
  typebots       Typebot[]
}

model Typebot {
  id                      String                    @id @default(cuid())
  version                 String?
  createdAt               DateTime                  @default(now())
  updatedAt               DateTime                  @default(now()) @updatedAt
  icon                    String?
  name                    String
  folderId                String?
  groups                  Json
  variables               Json
  edges                   Json
  theme                   Json
  selectedThemeTemplateId String?
  settings                Json
  publicId                String?                   @unique
  customDomain            String?                   @unique
  workspaceId             String
  resultsTablePreferences Json?
  folder                  DashboardFolder?          @relation(fields: [folderId], references: [id])
  workspace               Workspace                 @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  collaborators           CollaboratorsOnTypebots[]
  invitations             Invitation[]
  publishedTypebot        PublicTypebot?
  results                 Result[]
  webhooks                Webhook[]
  isArchived              Boolean                   @default(false)
  isClosed                Boolean                   @default(false)

  @@index([workspaceId])
  @@index([isArchived, createdAt(sort: Desc)])
}

model Invitation {
  createdAt DateTime          @default(now())
  updatedAt DateTime          @default(now()) @updatedAt
  email     String
  typebotId String
  type      CollaborationType
  typebot   Typebot           @relation(fields: [typebotId], references: [id], onDelete: Cascade)

  @@unique([email, typebotId])
}

model CollaboratorsOnTypebots {
  createdAt DateTime          @default(now())
  updatedAt DateTime          @default(now()) @updatedAt
  userId    String
  typebotId String
  type      CollaborationType
  typebot   Typebot           @relation(fields: [typebotId], references: [id], onDelete: Cascade)
  user      User              @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([userId, typebotId])
}

model PublicTypebot {
  id        String   @id @default(cuid())
  version   String?
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
  typebotId String   @unique
  groups    Json
  variables Json
  edges     Json
  theme     Json
  settings  Json
  typebot   Typebot  @relation(fields: [typebotId], references: [id], onDelete: Cascade)
}

model Result {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  typebotId   String
  variables   Json
  isCompleted Boolean
  hasStarted  Boolean?
  isArchived  Boolean? @default(false)
  typebot     Typebot  @relation(fields: [typebotId], references: [id], onDelete: Cascade)
  answers     Answer[]
  logs        Log[]

  @@index([typebotId, hasStarted, createdAt(sort: Desc)])
  @@index([typebotId, isCompleted])
}

model Log {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  resultId    String
  status      String
  description String
  details     String?
  result      Result   @relation(fields: [resultId], references: [id], onDelete: Cascade)

  @@index([resultId])
}

model Answer {
  createdAt   DateTime @default(now()) @updatedAt
  resultId    String
  blockId     String
  groupId     String
  variableId  String?
  content     String
  storageUsed Int?
  result      Result   @relation(fields: [resultId], references: [id], onDelete: Cascade)

  @@unique([resultId, blockId, groupId])
  @@index([groupId])
  @@index([storageUsed])
}

model Coupon {
  userPropertiesToUpdate Json
  code                   String    @id @unique
  dateRedeemed           DateTime?
}

model Webhook {
  id          String   @id @default(cuid())
  createdAt   DateTime @default(now())
  updatedAt   DateTime @default(now()) @updatedAt
  url         String?
  method      String
  queryParams Json
  headers     Json
  body        String?
  typebotId   String
  typebot     Typebot  @relation(fields: [typebotId], references: [id], onDelete: Cascade)
}

model ClaimableCustomPlan {
  id           String    @id @default(cuid())
  createdAt    DateTime  @default(now())
  claimedAt    DateTime?
  name         String
  description  String?
  price        Int
  currency     String
  workspaceId  String    @unique
  workspace    Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  chatsLimit   Int
  storageLimit Int
  seatsLimit   Int
  isYearly     Boolean   @default(false)
  companyName  String?
  vatType      String?
  vatValue     String?
}

model ChatSession {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now()) @updatedAt
  state     Json
}

model ThemeTemplate {
  id          String    @id @default(cuid())
  createdAt   DateTime  @default(now())
  updatedAt   DateTime  @default(now()) @updatedAt
  name        String
  theme       Json
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  workspaceId String
}

enum WorkspaceRole {
  ADMIN
  MEMBER
  GUEST
}

enum GraphNavigation {
  MOUSE
  TRACKPAD
}

enum Plan {
  FREE
  STARTER
  PRO
  LIFETIME
  OFFERED
  CUSTOM
  UNLIMITED
}

enum CollaborationType {
  READ
  WRITE
  FULL_ACCESS
}
baptisteArno commented 1 year ago

Ok so navigate to packages/prisma, then run prisma generate --schema C:\Users\BoB Dang\Downloads\typebot.io-main\typebot.io-main\packages\prisma\postgresql\schema.prisma. You should see the same error message.

Now try maybe prisma generate --schema ./postgresql/schema.prisma. Does that work?

NghiaDangTran commented 1 year ago

this so wierd, run prisma generate --schema ./postgresql/schema.prisma and it work

Environment variables loaded from .env
Prisma schema loaded from postgresql\schema.prisma

✔ Generated Prisma Client (4.14.1 | library) to .\..\..\node_modules\.pnpm\@prisma+client@4.14.1_prisma@4.14.1\node_modules\@prisma\client in 1.10s
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
NghiaDangTran commented 1 year ago

now it run but stuck in this state

PS C:\Users\BoB Dang\Documents\GitHub\typebot.io> pnpm dev

> typebot-os@2.14.1 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io
> pnpm docker:up && cross-env NEXT_PUBLIC_E2E_TEST=false turbo run dev --filter=builder... --filter=viewer... --parallel --no-cache

> typebot-os@2.14.1 docker:up C:\Users\BoB Dang\Documents\GitHub\typebot.io
> docker compose -f docker-compose.dev.yml up -d && timeout 5

[+] Running 22/3
 ✔ createbuckets Pulled                                                             6.6s 
 ✔ postgres 13 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                       35.8s 
 ✔ minio 6 layers [⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                  38.7s 
[+] Running 4/4
 ✔ Network typebotio_default            Created                                     0.8s 
 ✔ Container typebotio-minio-1          Started                                     3.3s 
 ✔ Container typebotio-postgres-1       Started                                     3.1s 
 ✔ Container typebotio-createbuckets-1  St...                                       3.8s 

Waiting for 2 seconds, press a key to continue ...
╭───────────────────────────────────────────────────────────────────────╮
│                                                                       │
│                   Update available v1.9.9 ≫ v1.10.5                   │
│    Changelog: https://github.com/vercel/turbo/releases/tag/v1.10.5    │
│               Run "npx @turbo/codemod update" to update               │
│                                                                       │
│     Follow @turborepo for updates: https://twitter.com/turborepo      │
╰───────────────────────────────────────────────────────────────────────╯
 WARNING  failed to contact turbod. Continuing in standalone mode: connection to turbo daemon process failed. Please ensure the following:
        - the process identified by the pid in the file at C:\Users\BOBDAN~1\AppData\Local\Temp\turbod\52b4abfe8eff6374\turbod.pid is not running, and remove C:\Users\BOBDAN~1\AppData\Local\Temp\turbod\52b4abfe8eff6374\turbod.pid
        - check the logs at C:\Users\BoB Dang\AppData\Roaming\turborepo\data\logs\52b4abfe8eff6374-typebot.io.log
        - the unix domain socket at C:\Users\BOBDAN~1\AppData\Local\Temp\turbod\52b4abfe8eff6374\turbod.sock has been removed
        You can also run without the daemon process by passing --no-daemon
• Packages in scope: @typebot.io/emails, @typebot.io/js, @typebot.io/lib, @typebot.io/prisma, @typebot.io/react, @typebot.io/schemas, @typebot.io/tsconfig, bot-engine, builder, eslint-config-custom, typebot-js, viewer
• Running dev in 12 packages
• Remote caching disabled
@typebot.io/prisma:db:generate: cache bypass, force executing 7b90fe4b133409c2
@typebot.io/prisma:db:push: cache bypass, force executing 6d92a7d5ad585a66
@typebot.io/prisma:db:push: 
@typebot.io/prisma:db:push: > @typebot.io/prisma@0.1.0 db:push C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\prisma
@typebot.io/prisma:db:push: > tsx scripts/db-push.ts
@typebot.io/prisma:db:push:
@typebot.io/prisma:db:generate:
@typebot.io/prisma:db:generate: > @typebot.io/prisma@0.1.0 db:generate C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\prisma
@typebot.io/prisma:db:generate: > tsx scripts/db-generate.ts
@typebot.io/prisma:db:generate:
@typebot.io/prisma:db:generate: Executing for PostgreSQL schema
@typebot.io/prisma:db:push: Executing for PostgreSQL schema
@typebot.io/prisma:db:push: Environment variables loaded from .env
@typebot.io/prisma:db:push: Prisma schema loaded from postgresql\schema.prisma
@typebot.io/prisma:db:push: Datasource "db": PostgreSQL database "typebot", schema "public" at "localhost:5432"
@typebot.io/prisma:db:push:
@typebot.io/prisma:db:push: Your database is now in sync with your Prisma schema. Done in 1.03s
@typebot.io/prisma:db:push:
@typebot.io/prisma:db:push:
@typebot.io/prisma:db:generate: Environment variables loaded from .env
@typebot.io/prisma:db:generate: Prisma schema loaded from postgresql\schema.prisma       
@typebot.io/prisma:db:generate:
@typebot.io/prisma:db:generate: ✔ Generated Prisma Client (4.14.1 | library) to .\..\..\node_modules\.pnpm\@prisma+client@4.14.1_prisma@4.14.1\node_modules\@prisma\client in 1.21s
@typebot.io/prisma:db:generate: You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
@typebot.io/prisma:db:generate: ```
@typebot.io/prisma:db:generate: import { PrismaClient } from '@prisma/client'
@typebot.io/prisma:db:generate: const prisma = new PrismaClient()
@typebot.io/prisma:db:generate: ```
@typebot.io/prisma:db:generate:
@typebot.io/js:dev: cache bypass, force executing 82585a63347ef250
@typebot.io/prisma:dev: cache bypass, force executing 5c7a1f73f7dd07ee
viewer:dev: cache bypass, force executing ef7e530486d59339
typebot-js:dev: cache bypass, force executing ddba253a5965d71f
@typebot.io/react:dev: cache bypass, force executing 3b8d16fae146a7ce
bot-engine:dev: cache bypass, force executing 65e11459c2da55db
builder:dev: cache bypass, force executing 636e89e9294400c0
@typebot.io/js:dev:  WARN  Issue while reading "C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\embeds\js\.npmrc". Failed to replace env in config: ${NPM_TOKEN}
@typebot.io/react:dev:  WARN  Issue while reading "C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\embeds\react\.npmrc". Failed to replace env in config: ${NPM_TOKEN}     
@typebot.io/js:dev:
@typebot.io/js:dev: > @typebot.io/js@0.0.63 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\embeds\js
@typebot.io/js:dev: > rollup --watch --config rollup.config.js
@typebot.io/js:dev:
@typebot.io/prisma:dev: 
@typebot.io/prisma:dev: > @typebot.io/prisma@0.1.0 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\prisma
@typebot.io/prisma:dev: > tsx scripts/studio.ts
@typebot.io/prisma:dev:
typebot-js:dev: 
typebot-js:dev: > typebot-js@2.2.17 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\deprecated\typebot-js
typebot-js:dev: > tsup --watch
typebot-js:dev: 
builder:dev:
builder:dev: > builder@0.1.0 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\apps\builder
builder:dev: > cross-env ENVSH_ENV=.env.local bash ../../scripts/inject-runtime-env.sh next dev -p 3000
builder:dev:
@typebot.io/react:dev: 
@typebot.io/react:dev: > @typebot.io/react@0.0.63 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\embeds\react
@typebot.io/react:dev: > rollup --watch --config rollup.config.js
@typebot.io/react:dev: 
viewer:dev: 
viewer:dev: > viewer@0.1.0 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\apps\viewer 
viewer:dev: > cross-env ENVSH_ENV=.env.local bash ../../scripts/inject-runtime-env.sh next dev -p 3001
viewer:dev: 
bot-engine:dev: 
bot-engine:dev: > bot-engine@0.1.0 dev C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\deprecated\bot-engine
bot-engine:dev: > tsup --watch
bot-engine:dev:
@typebot.io/prisma:dev: Executing for PostgreSQL schema
                                                       viewer:dev:  ELIFECYCLE  Command failed with exit code 1.
builder:dev:  ELIFECYCLE  Command failed with exit code 1.
viewer:dev: ERROR: command finished with error: command (C:\Users\BoB Dang\Documents\GitHub\typebot.io\apps\viewer) pnpm run dev exited (1)
builder:dev: ERROR: command finished with error: command (C:\Users\BoB Dang\Documents\GitHub\typebot.io\apps\builder) pnpm run dev exited (1)
bot-engine:dev: CLI Building entry: src/index.ts
typebot-js:dev: CLI Building entry: src/index.ts
bot-engine:dev: CLI Using tsconfig: tsconfig.json
typebot-js:dev: CLI Using tsconfig: tsconfig.json
bot-engine:dev: CLI tsup v6.5.0
bot-engine:dev: CLI Using tsup config: C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\deprecated\bot-engine\tsup.config.js
bot-engine:dev: CLI Running in watch mode
typebot-js:dev: CLI tsup v6.5.0
typebot-js:dev: CLI Using tsup config: C:\Users\BoB Dang\Documents\GitHub\typebot.io\packages\deprecated\typebot-js\tsup.config.js
typebot-js:dev: CLI Running in watch mode
bot-engine:dev: CLI Target: es6
typebot-js:dev: CLI Target: node14
typebot-js:dev: ESM Build start
typebot-js:dev: CJS Build start
typebot-js:dev: IIFE Build start
bot-engine:dev: ESM Build start
bot-engine:dev: CJS Build start
typebot-js:dev: IIFE dist\index.global.js     22.50 KB
typebot-js:dev: IIFE dist\index.global.js.map 37.50 KB
typebot-js:dev: IIFE ⚡️ Build success in 927ms
typebot-js:dev: ESM dist\index.mjs     20.42 KB
typebot-js:dev: ESM dist\index.mjs.map 37.15 KB
typebot-js:dev: ESM ⚡️ Build success in 977ms
typebot-js:dev: CJS dist\index.js     21.79 KB
typebot-js:dev: CJS dist\index.js.map 37.25 KB
typebot-js:dev: CJS ⚡️ Build success in 1139ms
typebot-js:dev: CLI Watching for changes in "."
typebot-js:dev: CLI Ignoring changes in "**/{.git,node_modules}/**" | "dist"
typebot-js:dev: DTS Build start
typebot-js:dev: DTS ⚡️ Build success in 8016ms
@typebot.io/react:dev: rollup v3.20.2
@typebot.io/react:dev: bundles ./src/index.ts → dist/index.js...
@typebot.io/js:dev: rollup v3.20.2
@typebot.io/js:dev: bundles ./src/index.ts → dist/index.js...
bot-engine:dev: DTS Build start
bot-engine:dev: CJS dist\index.js     306.68 KB
bot-engine:dev: CJS dist\index.js.map 540.13 KB
bot-engine:dev: CJS ⚡️ Build success in 36320ms
bot-engine:dev: ESM dist\gtag-Y56LIEPH.mjs      165.00 B
bot-engine:dev: ESM dist\chunk-FGP6AKC5.mjs     2.88 KB
bot-engine:dev: ESM dist\index.mjs              296.21 KB
bot-engine:dev: ESM dist\gtag-Y56LIEPH.mjs.map  71.00 B
bot-engine:dev: ESM dist\chunk-FGP6AKC5.mjs.map 2.09 KB
bot-engine:dev: ESM dist\index.mjs.map          540.50 KB
bot-engine:dev: ESM ⚡️ Build success in 36519ms
bot-engine:dev: CLI Watching for changes in "."
bot-engine:dev: CLI Ignoring changes in "**/{.git,node_modules}/**" | "dist"
bot-engine:dev: DTS ⚡️ Build success in 48422ms
@typebot.io/react:dev: (!) Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module '@typebot.io/js' or its corresponding type declarations.
@typebot.io/react:dev: src/Bubble.tsx: (2:34)
@typebot.io/react:dev: 
@typebot.io/react:dev: 2 import type { BubbleProps } from '@typebot.io/js'
@typebot.io/react:dev:                                    ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/Popup.tsx: (2:33)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import type { PopupProps } from '@typebot.io/js'
@typebot.io/react:dev:                                   ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/Standard.tsx: (2:31)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import type { BotProps } from '@typebot.io/js'
@typebot.io/react:dev:                                 ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/stories/bubble.stories.tsx: (9:8)
@typebot.io/react:dev:
@typebot.io/react:dev: 9 } from '@typebot.io/js'
@typebot.io/react:dev:          ~~~~~~~~~~~~~~~~
@typebot.io/react:dev: 
@typebot.io/react:dev: src/stories/popup.stories.tsx: (2:30)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import { open, toggle } from '@typebot.io/js'
@typebot.io/react:dev:                                ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/Bubble.tsx: (2:34)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import type { BubbleProps } from '@typebot.io/js'
@typebot.io/react:dev:                                    ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/Popup.tsx: (2:33)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import type { PopupProps } from '@typebot.io/js'
@typebot.io/react:dev:                                   ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/Standard.tsx: (2:31)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import type { BotProps } from '@typebot.io/js'
@typebot.io/react:dev:                                 ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/stories/bubble.stories.tsx: (9:8)
@typebot.io/react:dev:
@typebot.io/react:dev: 9 } from '@typebot.io/js'
@typebot.io/react:dev:          ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: src/stories/popup.stories.tsx: (2:30)
@typebot.io/react:dev:
@typebot.io/react:dev: 2 import { open, toggle } from '@typebot.io/js'
@typebot.io/react:dev:                                ~~~~~~~~~~~~~~~~
@typebot.io/react:dev:
@typebot.io/react:dev: (!) Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module '@typebot.io/js/dist/web' or its corresponding type declarations.
@typebot.io/react:dev: src/Bubble.tsx: (25:20)
@typebot.io/react:dev:
@typebot.io/react:dev: https://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency
@typebot.io/react:dev: @typebot.io/js/dist/web (imported by "src/Bubble.tsx", "src/Standard.tsx" and "src/Popup.tsx")    
@typebot.io/react:dev: created dist/index.js in 42.9s
@typebot.io/js:dev: created dist/index.js in 38.9s
@typebot.io/js:dev: bundles ./src/web.ts → dist/web.js...
@typebot.io/js:dev: created dist/web.js in 27.8s
baptisteArno commented 1 year ago

It can be safely ignored 😄

Just so that I make sure the issue is fixed for every Win users, can you tell me if this command also works?

prisma generate --schema "C:\Users\BoB Dang\Downloads\typebot.io-main\typebot.io-main\packages\prisma\postgresql\schema.prisma"
NghiaDangTran commented 1 year ago

It did not run, and btw after i edit the script directory to just run from "./postgresql/schema.prisma" and then I run '''pnpm dev''' and got the above error, but I ca'nt still access any localhost:3000 or 3001, is there a fix for this issue?

On Fri., Jun. 23, 2023, 5:23 p.m. Baptiste Arnaud, @.***> wrote:

It can be safely ignored 😄

Just so that I make sure the issue is fixed for every Win users, can you tell me if this command also works?

prisma generate --schema "C:\Users\BoB Dang\Downloads\typebot.io-main\typebot.io-main\packages\prisma\postgresql\schema.prisma"

— Reply to this email directly, view it on GitHub https://github.com/baptisteArno/typebot.io/issues/573#issuecomment-1604066615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH6HVZX6HZZ7QWZFDYJ32XLXMVVCPANCNFSM6AAAAAAZQNQABY . You are receiving this because you authored the thread.Message ID: @.***>

baptisteArno commented 1 year ago

but I ca'nt still access any localhost:3000 or 3001

What are you seeing? You should have more error in the logs. I don't think it would end with:

@typebot.io/react:dev: created dist/index.js in 42.9s
@typebot.io/js:dev: created dist/index.js in 38.9s
@typebot.io/js:dev: bundles ./src/web.ts → dist/web.js...
@typebot.io/js:dev: created dist/web.js in 27.8s