ocluf / justship

A svelte 5 and sveltekit saas boilerplate. Including database, authentication, email, analytics
https://justship.today
MIT License
451 stars 31 forks source link

Zod error in drizzle when running npm run generate #15

Open s1n7ax opened 5 days ago

s1n7ax commented 5 days ago

Steps to reproduce.

  1. Clone the project
  2. pnpm install
  3. rename .env.example to .env and add the FROM_EMAIL=team@something.com
  4. run pnpm run generate
❯ npm run generate                   

> justship2@0.0.1 generate /home/s1n7ax/Workspace/justship
> drizzle-kit generate

No config path provided, using default 'drizzle.config.ts'
Reading config file '/home/s1n7ax/Workspace/justship/drizzle.config.ts'
_ZodError: [
  {
    "code": "invalid_union",
    "unionErrors": [
      {
        "issues": [
          {
            "code": "invalid_union",
            "unionErrors": [
              {
                "issues": [
                  {
                    "received": "turso",
                    "code": "invalid_literal",
                    "expected": "d1-http",
                    "path": [
                      "driver"
                    ],
                    "message": "Invalid literal value, expected \"d1-http\""
                  }
                ],
                "name": "ZodError"
              },
              {
                "issues": [
                  {
                    "received": "turso",
                    "code": "invalid_literal",
                    "expected": "expo",
                    "path": [
                      "driver"
                    ],
                    "message": "Invalid literal value, expected \"expo\""
                  }
                ],
                "name": "ZodError"
              }
            ],
            "path": [
              "driver"
            ],
            "message": "Invalid input"
          }
        ],
        "name": "ZodError"
      },
      {
        "issues": [
          {
            "code": "invalid_union",
            "unionErrors": [
              {
                "issues": [
                  {
                    "received": "turso",
                    "code": "invalid_literal",
                    "expected": "aws-data-api",
                    "path": [
                      "driver"
                    ],
                    "message": "Invalid literal value, expected \"aws-data-api\""
                  }
                ],
                "name": "ZodError"
              },
              {
                "issues": [
                  {
                    "received": "turso",
                    "code": "invalid_literal",
                    "expected": "pglite",
                    "path": [
                      "driver"
                    ],
                    "message": "Invalid literal value, expected \"pglite\""
                  }
                ],
                "name": "ZodError"
              }
            ],
            "path": [
              "driver"
            ],
            "message": "Invalid input"
          }
        ],
        "name": "ZodError"
      }
    ],
    "path": [
      "driver"
    ],
    "message": "Invalid input"
  }
]
    at get error (/home/s1n7ax/Workspace/justship/node_modules/.pnpm/drizzle-kit@0.26.2/node_modules/drizzle-kit/bin
.cjs:2172:28)
    at drizzleConfigFromFile (/home/s1n7ax/Workspace/justship/node_modules/.pnpm/drizzle-kit@0.26.2/node_modules/dri
zzle-kit/bin.cjs:18026:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async prepareGenerateConfig (/home/s1n7ax/Workspace/justship/node_modules/.pnpm/drizzle-kit@0.26.2/node_modul
es/drizzle-kit/bin.cjs:17596:42)
    at async run (/home/s1n7ax/Workspace/justship/node_modules/.pnpm/drizzle-kit@0.26.2/node_modules/drizzle-kit/bin
.cjs:85613:51) {
  issues: [
    {
      code: 'invalid_union',
      unionErrors: [Array],
      path: [Array],
      message: 'Invalid input'
    }
  ],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  errors: [
    {
      code: 'invalid_union',
      unionErrors: [Array],
      path: [Array],
      message: 'Invalid input'
    }
  ]
}
 ELIFECYCLE  Command failed with exit code 1.
ocluf commented 4 days ago

Looks like I need to removedriver: 'turso', from the drizzle config. And change dialect from sqlite to turso

I have been updating the dependencies without testing them which obviously isn't great.

I'm currently doing a rewrite changing the component library to shadcn-svelte and I will add tests so I can upgrade a bit more fearlessly and not break things