Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Scope, Config, FilesOption } from 'harper';
import { flushDatabases, type Scope, type Config, type FilesOption } from 'harper';

Check failure on line 1 in src/plugin.ts

View workflow job for this annotation

GitHub Actions / Integration Tests (Node 20)

Module '"harper"' has no exported member 'flushDatabases'.

Check failure on line 1 in src/plugin.ts

View workflow job for this annotation

GitHub Actions / Integration Tests (Node 22)

Module '"harper"' has no exported member 'flushDatabases'.

Check failure on line 1 in src/plugin.ts

View workflow job for this annotation

GitHub Actions / Integration Tests (Node 24)

Module '"harper"' has no exported member 'flushDatabases'.

import { createRequire } from 'node:module';
import { parse as urlParse } from 'node:url';
Expand Down Expand Up @@ -270,6 +270,11 @@

scope.logger.debug?.(`Building Next.js application at ${scope.directory}`);

// Next.js generates static pages using child processes and only a single process can open the
// RocksDB databases, so force Harper to start in read-only mode
process.env.HARPER_READONLY = 'true';
await flushDatabases();

// --expose-internals is set in Harper's worker execArgv but is not allowed in NODE_OPTIONS.
// Next.js reads process.execArgv to forward flags to its own child workers via NODE_OPTIONS,
// which causes Node to reject the build worker. Strip it before building and restore after.
Expand Down
Loading