ERR_OSSL_PEM_NO_START_LINE when using DevTools() plugin alongside laravel-vite-plugin (HTTPS dev server)
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
- Install
laravel-vite-plugin(v3.x) in a project that uses Laravel Herd or Valet (auto-configuresserver.https) - Add
DevTools()to plugins invite.config.ts - 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:
- Expose a
websocketoption inDevToolsOptionsso callers can explicitly passhttps: false - Wrap the
https.createServer()call in a try/catch insideattachWsRpcTransportand fall back to a plain WS server if TLS setup fails - Don't inherit
viteConfig.server.httpsby default — require it to be opted in explicitly
Can you share a minimal reproduction? Thanks