@harperdb/nextjs
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -15,3 +15,2 @@ #!/usr/bin/env node | ||
HARPERDB_NEXTJS_MODE: mode, | ||
THREADS_DEBUG: mode === 'dev' ? 'true' : 'false', | ||
}, | ||
@@ -18,0 +17,0 @@ }); |
@@ -321,12 +321,19 @@ /* eslint-env node */ | ||
const servers = server.http( | ||
(request) => requestHandler(request._nodeRequest, request._nodeResponse, urlParse(request._nodeRequest.url, true)), | ||
(request, next) => { | ||
return request._nodeResponse === undefined | ||
? next(request) | ||
: requestHandler(request._nodeRequest, request._nodeResponse, urlParse(request._nodeRequest.url, true)); | ||
}, | ||
{ port: config.port, securePort: config.securePort } | ||
); | ||
if (config.dev) { | ||
// Next.js v9 doesn't have an upgrade handler | ||
if (config.dev && app.getUpgradeHandler) { | ||
const upgradeHandler = app.getUpgradeHandler(); | ||
servers[0].on('upgrade', (req, socket, head) => { | ||
return upgradeHandler(req, socket, head); | ||
if (req.url !== '/_next/webpack-hmr') { | ||
return upgradeHandler(req, socket, head); | ||
} | ||
}); | ||
} | ||
} |
{ | ||
"name": "@harperdb/nextjs", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"type": "module", | ||
@@ -38,3 +38,3 @@ "description": "A HarperDB Component for running Next.js apps.", | ||
"format:fix": "npm run format -- --write", | ||
"lint": "eslint extension.js cli.js" | ||
"lint": "eslint ." | ||
}, | ||
@@ -41,0 +41,0 @@ "dependencies": { |
@@ -125,3 +125,3 @@ # @harperdb/nextjs | ||
### `port: number` | ||
### `securePort: number` | ||
@@ -140,2 +140,5 @@ Specify a secure port for the Next.js server. Defaults to the HarperDB default secure port. | ||
> [!NOTE] | ||
> Dev mode for Next.js v13+ relies on WebSockets. If you encounter an `Invalid WebSocket frame:` error, disable any other WebSocket services on the Next.js port. This commonly can be the HarperDB MQTT WebSocket service, which can be configured under the `mqtt` option within `harperdb-config.yaml`. | ||
### `build` | ||
@@ -142,0 +145,0 @@ |
18124
332
153