rabbit_rabbitR
Denoβ€’2mo ago
rabbit_rabbit

Https in Fresh 2 with Vite?

Hello! I'm in the process of upgrading from Fresh 1 to Fresh 2. I want to be able to run locally using https. It looks like http2.createSecureServer is not implemented in the latest deno yet? Thanks in advance!

deno task start
Task start vite
error when starting dev server:
Error [ERR_NOT_IMPLEMENTED]: Not implemented: http2.createSecureServer
    at notImplemented (ext:deno_node/_utils.ts:9:9)
    at createSecureServer (node:http2:1299:3)
    at resolveHttpServer (file:///Users/willweiss/dev/morehumaninternet/virtual-hospitals-africa/node_modules/.deno/vite@7.1.12_1/node_modules/vite/dist/node/chunks/config.js:18319:10)
    at eventLoopTick (ext:core/01_core.js:179:7)
    at async _createServer (file:///Users/willweiss/dev/morehumaninternet/virtual-hospitals-africa/node_modules/.deno/vite@7.1.12_1/node_modules/vite/dist/node/chunks/config.js:27953:45)
    at async CAC.<anonymous> (file:///Users/willweiss/dev/morehumaninternet/virtual-hospitals-africa/node_modules/.deno/vite@7.1.12_1/node_modules/vite/dist/node/cli.js:572:18)


My vite.config.ts looks like this

import { defineConfig } from 'vite'
import { fresh } from '@fresh/plugin-vite'
import tailwindcss from '@tailwindcss/vite'
import { promiseProps } from './util/promiseProps.ts'

const httpsOpts = await promiseProps({
  key: Deno.readTextFile('./local-certs/localhost.key'),
  cert: Deno.readTextFile('./local-certs/localhost.crt'),
})

export default defineConfig({
  plugins: [
    fresh(),
    tailwindcss(),
  ],
  server: {
    port: 8000,
    https: httpsOpts,
  },
})
Was this page helpful?