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-configures server.https)
- Add
DevTools() to plugins in vite.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
websocket option in DevToolsOptions so callers can explicitly pass https: false
- Wrap the
https.createServer() call in a try/catch inside attachWsRpcTransport and fall back to a plain WS server if TLS setup fails
- Don't inherit
viteConfig.server.https by default — require it to be opted in explicitly
Description
When
laravel-vite-pluginis active alongsideDevTools(), starting the Vite dev server throws anERR_OSSL_PEM_NO_START_LINEerror and the server fails to start.The
laravel-vite-pluginautomatically configuresserver.httpswith Herd/Valet SSL certificates. TheDevToolsServerplugin callscreateDevToolsMiddlewarewithout an explicitwebsocket.httpsvalue, soserver-C2pAbK9p.jsline 26 falls back toviteConfig.server.https:This value — a valid config for Vite's own server — is then passed directly to Node's
https.createServer(https)insidedevframe'sattachWsRpcTransport, where OpenSSL fails to parse it.Steps to reproduce
laravel-vite-plugin(v3.x) in a project that uses Laravel Herd or Valet (auto-configuresserver.https)DevTools()to plugins invite.config.tsvite(dev server)Error
Versions
@vitejs/devtoolsvitelaravel-vite-plugindevframeSuggested fix
DevToolsOptionshas no way to passwebsocket.https: falsethrough tocreateDevToolsMiddleware. One of the following would resolve it:websocketoption inDevToolsOptionsso callers can explicitly passhttps: falsehttps.createServer()call in a try/catch insideattachWsRpcTransportand fall back to a plain WS server if TLS setup failsviteConfig.server.httpsby default — require it to be opted in explicitly