Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
createWebPlsqlMiddleware
✓ import { createWebPlsqlMiddleware } from 'web_plsql';
✗ const web_plsql = require('web_plsql');
The package exports a named function; default or wildcard imports are incorrect as the module is ESM-only (engine requirement suggests modern ESM).
WebPlsqlMiddlewareOptions
✓ import type { WebPlsqlMiddlewareOptions } from 'web_plsql';
✗ const { WebPlsqlMiddlewareOptions } = require('web_plsql');
Options type is exported as a TypeScript type; cannot be accessed at runtime with CommonJS require().
WebPlsqlRequestHandler
✓ import type { WebPlsqlRequestHandler } from 'web_plsql';
✗ import { WebPlsqlRequestHandler } from 'web_plsql';
WebPlsqlRequestHandler is only a type, not a runtime value; use type-only import to avoid bundler issues.
Demonstrates setting up Express with Oracle connection pool and web_plsql middleware with path aliases.
import express from 'express';
import oracledb from 'oracledb';
import { createWebPlsqlMiddleware } from 'web_plsql';
const app = express();
const port = process.env.PORT ?? 3000;
const pool = await oracledb.createPool({
user: process.env.DB_USER ?? 'user',
password: process.env.DB_PASSWORD ?? 'password',
connectString: process.env.DB_CONNECT_STRING ?? 'localhost:1521/ORCL'
});
const middleware = createWebPlsqlMiddleware({
pool,
defaultPage: 'home',
pathAlias: {
'/api': { procedure: 'my_package.proc' }
}
});
app.use('/pls', middleware);
app.listen(port, () => {
console.log(`Server running on port ${port}`);
});
Debug
Known issues
breakingNode.js >=24 is required; older versions will fail.fixUpgrade to Node.js 24 or later.
affects: <1.0.0 || >=1.0.0
breakingPeer dependency oracledb 6.10.0 is mandatory; mismatched versions cause runtime errors.fixInstall oracledb@6.10.0 explicitly.
affects: >=1.0.0
deprecatedThe 'redirectPath' option is deprecated and will be removed in v2.0.fixUse 'pathAlias' and configure redirects manually.
affects: >=1.5.0
gotchaThe middleware expects the Oracle pool to be already created; passing a promise or uninitialized pool causes a crash.fixEnsure pool is fully initialized (await oracledb.createPool(...)) before passing to createWebPlsqlMiddleware().
affects: >=1.0.0
gotchaWhen using TypeScript, type imports (e.g., WebPlsqlMiddlewareOptions) must use import type syntax to avoid runtime errors.fixUse import type { ... } from 'web_plsql' for type-only exports. affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'oracledb'
Missing peer dependency oracledb.
fixnpm install oracledb@6.10.0
TypeError: createWebPlsqlMiddleware is not a function
Incorrect import; using default import instead of named import.
fixUse import { createWebPlsqlMiddleware } from 'web_plsql'. Error: DPI-1047: Cannot locate a 64-bit Oracle Client library
Oracle Instant Client not installed or not in the system library path.
fixInstall and configure Oracle Instant Client (e.g., set LD_LIBRARY_PATH or use oracledb.initOracleClient()).
Audit
Dependencies
oracledbrequiredRequired for Oracle database connectivity; version 6.10.0 is mandatory.