Skip to content

Drizzle Studio with PGlite doesn't support https dev server #747

@ProgramRipper

Description

@ProgramRipper

Describe the bug
Drizzle Studio with PGlite needs to fetch nitro dev backend, and the url is hardcoded with plain http schema:

const nitroDevUrl = `http://localhost:${nuxt.options.devServer.port || 3000}`

which doesn't support https dev server and we will get the following error:

[nuxt:hub] ℹ Launching Drizzle Studio with PGlite...

[nuxt:hub]  ERROR  Failed to launch Drizzle Studio: fetch failed

    at node:internal/deps/undici/undici:13510:13
    at async launchDrizzleStudio (node_modules/@nuxthub/core/dist/module.mjs:710:9)

  [cause]: other side closed

      at Socket.<anonymous> (node:internal/deps/undici/undici:6294:28)
      at Socket.emit (node:events:536:35)
      at endReadableNT (node:internal/streams/readable:1698:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Steps to reproduce
Steps to reproduce the behavior:

  1. nuxt.config.ts
export default defineNuxtConfig({
  devServer: {
    https: {
      key: "localhost-key.pem",
      cert: "localhost.pem",
    },
  },

  modules: ["@nuxthub/core"],
  hub: {
    db: "postgresql",
  },
});
  1. Click Launch button in Nuxt Devtools Database page.
  2. See error in nuxt dev console.

Expected behavior
The following patch work on my machine:

        const nitroDevUrl = `${nuxt.options.devServer.https ? 'https' : 'http'}://localhost:${nuxt.options.devServer.port || 3e3}`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions