We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apologies if this is in the wrong place, however I was not sure if I should have made this issue with Bun, require-in-the-middle, or PM2
Bun: 1.2.5 PM2: 6.0.5 OS: Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64)
Bun has a native PostgreSQL binding as documented here
With the below code, I can run it using "bun run" without any issues:
.env:
POSTGRES_URL = postgres://advance:advance@localhost:5432/advance
test-sql.ts
import { sql } from "bun"; console.log(await sql`SELECT version()`)
running:
bun run test-sql.ts
returns:
[ { version: "PostgreSQL 16.8 (Ubuntu 16.8-0ubuntu0.24.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0, 64-bit", }, count: 1, command: "SELECT" ]
However when I try to run the same code via PM2, I get the below error:
96 | const isPatching = patching.has(filename) 97 | if (isPatching === false) { 98 | patching.add(filename) 99 | } 100 | 101 | const exports = self._origRequire.apply(this, arguments) ^ TypeError: require() async module "/home/lemres/badvance/test-sql.ts" is unsupported. use "await import()" instead. at <anonymous> (/home/lemres/.bun/install/global/node_modules/require-in-the-middle/index.js:101:39) at <anonymous> (/home/lemres/.bun/install/global/node_modules/pm2/lib/ProcessContainerForkBun.js:27:1)
I have tried to start with and without interpreter, however both unfortunately returned the same error.
pm2 start test-sql.ts --name test-sql --attach pm2 start test-sql.ts --name test-sql --attach --interpreter bun
Please let me know if I'm searching in the wrong direction or if you require any further information.
The text was updated successfully, but these errors were encountered:
looks like it's bun oven-sh/bun#18478
Sorry, something went wrong.
require.extensions
yes, this is a bug in bun that will be fixed in the linked PR
Successfully merging a pull request may close this issue.
Apologies if this is in the wrong place, however I was not sure if I should have made this issue with Bun, require-in-the-middle, or PM2
Bun: 1.2.5
PM2: 6.0.5
OS: Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-55-generic x86_64)
Bun has a native PostgreSQL binding as documented here
With the below code, I can run it using "bun run" without any issues:
.env:
test-sql.ts
running:
returns:
However when I try to run the same code via PM2, I get the below error:
I have tried to start with and without interpreter, however both unfortunately returned the same error.
Please let me know if I'm searching in the wrong direction or if you require any further information.
The text was updated successfully, but these errors were encountered: