Skip to content

ERR_OSSL_PEM_NO_START_LINE when using DevTools() plugin alongside laravel-vite-plugin (HTTPS dev server) #345

@Rorymercer

Description

@Rorymercer

Description

When laravel-vite-plugin is active alongside DevTools(), starting the Vite dev server throws an ERR_OSSL_PEM_NO_START_LINE error and the server fails to start.

The laravel-vite-plugin automatically configures server.https with Herd/Valet SSL certificates. The DevToolsServer plugin calls createDevToolsMiddleware without an explicit websocket.https value, so server-C2pAbK9p.js line 26 falls back to viteConfig.server.https:

const https = options.websocket.https === false
  ? void 0
  : options.websocket.https ?? options.context.viteConfig.server.https;

This value — a valid config for Vite's own server — is then passed directly to Node's https.createServer(https) inside devframe's attachWsRpcTransport, where OpenSSL fails to parse it.

Steps to reproduce

  1. Install laravel-vite-plugin (v3.x) in a project that uses Laravel Herd or Valet (auto-configures server.https)
  2. Add DevTools() to plugins in vite.config.ts
  3. Run vite (dev server)

Error

Error: error:0480006C:PEM routines::no start line
    at node:internal/tls/secure-context:70:13
    at Array.forEach (<anonymous>)
    at setCerts (node:internal/tls/secure-context:68:3)
    at configSecureContext (node:internal/tls/secure-context:191:5)
    at Object.createSecureContext (node:internal/tls/common:113:3)
    at Server.setSecureContext (node:internal/tls/wrap:1512:27)
    at Server (node:internal/tls/wrap:1376:8)
    at new Server (node:https:93:3)
    at createServer (node:https:148:10)
    at attachWsRpcTransport (file:///…/node_modules/devframe/dist/rpc/transports/ws-server.mjs:19:23)

Versions

Package Version
@vitejs/devtools 0.1.22
vite 8.0.12
laravel-vite-plugin 3.1.0
devframe 0.1.22
Node.js 24.14.1
OS macOS

Suggested fix

DevToolsOptions has no way to pass websocket.https: false through to createDevToolsMiddleware. One of the following would resolve it:

  1. Expose a websocket option in DevToolsOptions so callers can explicitly pass https: false
  2. Wrap the https.createServer() call in a try/catch inside attachWsRpcTransport and fall back to a plain WS server if TLS setup fails
  3. Don't inherit viteConfig.server.https by default — require it to be opted in explicitly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions