blocklet with prisma wont start
hello!
i am trying to use prisma in my blocklet. but it times out when trying to start it. i've attached the deployment logs and error logs. it keeps trying to download a version of prisma that's already in package.json. please help! here is my pre-install hook.
zNKd2QuvqNpNi2Aavsmb71zRGDYHcXLfozbj.20241202160528.log.zipzNKd2QuvqNpNi2Aavsmb71zRGDYHcXLfozbj.20241202155951.log.zip
require('dotenv-flow').config();
const exec = require('shelljs').exec;
async function createSqliteDatabase() {
const urlJoin = (await import('url-join')).default; // Dynamically import url-join
console.log(process.cwd());
exec(`npx prisma@latest generate`);
process.env.DATABASE_URL = `file:${urlJoin(env.dataDir, 'db/prd.db')}`;
}
(async () => {
try {
await createSqliteDatabase();
} catch (err) {
console.error(`pre-start error`, err.message);
process.exit(1);
}
})();
3 条回复
so i have a preInstall hook of
npx prisma generateand then set an env var for my DATABASE_URL and the blocklet will not start in time.it gets stuck in this loop and then times out. please help z1VV21NqNWkiadznN32ALkos5dQqQwnCMty
2024-12-04T01:50:52: Prisma schema loaded from schema.prisma2024-12-04T01:50:53:2024-12-04T01:50:53: ✔ Generated Prisma Client (v6.0.1) to ./node_modules/.pnpm/@prisma+client@6.0.1_prisma@6.0.1/node_modules/@prisma/client in 96ms2024-12-04T01:50:53:2024-12-04T01:50:53: Start by importing your Prisma Client (See:https://pris.ly/d/importing-client))2024-12-04T01:50:53:2024-12-04T01:50:53: Tip: Want to react to database changes in your app as they happen? Discover how with Pulse:https://pris.ly/tip-1-pulse2024-12-04T01:50:53:2024-12-04T01:50:54: WARN using --force I sure hope you know what you are doing2024-12-04T01:50:54: Lockfile is up to date, resolution step is skipped2024-12-04T01:50:54: Progress: resolved 1, reused 0, downloaded 0, added 02024-12-04T01:50:54: Packages: +82024-12-04T01:50:54: ++++++++2024-12-04T01:50:54:2024-12-04T01:50:54: ╭──────────────────────────────────────────────────────────────────╮2024-12-04T01:50:54: │ │2024-12-04T01:50:54: │ Update available! 9.13.2 → 9.14.4. │2024-12-04T01:50:54: │ Changelog:https://github.com/pnpm/pnpm/releases/tag/v9.14.4│2024-12-04T01:50:54: │ Run "pnpm add -g pnpm" to update. │2024-12-04T01:50:54: │ │2024-12-04T01:50:54: │ Follow @pnpmjs for updates:https://x.com/pnpmjs│2024-12-04T01:50:54: │ │2024-12-04T01:50:54: ╰──────────────────────────────────────────────────────────────────╯2024-12-04T01:50:54:2024-12-04T01:50:55: Progress: resolved 8, reused 0, downloaded 8, added 62024-12-04T01:50:55: Progress: resolved 8, reused 0, downloaded 8, added 8, done2024-12-04T01:50:55: .../node_modules/@prisma/engines postinstall$ node scripts/postinstall.js2024-12-04T01:50:55: .../node_modules/@prisma/engines postinstall: Done2024-12-04T01:50:56: .../prisma@6.0.1/node_modules/prisma preinstall$ node scripts/preinstall-entry.js2024-12-04T01:50:56: .../prisma@6.0.1/node_modules/prisma preinstall: Done2024-12-04T01:50:56: .../node_modules/@prisma/client postinstall$ node scripts/postinstall.js2024-12-04T01:50:57: .../node_modules/@prisma/client postinstall: Prisma schema loaded from schema.prisma2024-12-04T01:50:57: .../node_modules/@prisma/client postinstall: ✔ Generated Prisma Client (v6.0.1) to ./node_modules/.pnpm/@prisma+client@6.0.1_prisma@6.0.1/node_modules/@prisma/client in 96ms2024-12-04T01:50:57: .../node_modules/@prisma/client postinstall: Start by importing your Prisma Client (See:https://pris.ly/d/importing-client))2024-12-04T01:50:57: .../node_modules/@prisma/client postinstall: Tip: Easily identify and fix slow SQL queries in your app. Optimize helps you enhance your visibility:https://pris.ly/--optimize2024-12-04T01:50:57: .../node_modules/@prisma/client postinstall: Done2024-12-04T01:50:57:2024-12-04T01:50:57: devDependencies: skipped because NODE_ENV is set to production2024-12-04T01:50:57:2024-12-04T01:50:57: Done in 4.3s2024-12-04T01:50:59: app dir /var/lib/blocklet/blocklets/z2qaKzYnBQHND4XND2jz3648T7RjxRhUxwmNL/0.1.602024-12-04T01:50:59: > bahnk-money v0.1.60 ready on 83322024-12-04T01:51:02: start z2qaKzYnBQHND4XND2jz3648T7RjxRhUxwmNL in docker: --network host, start2024-12-04T01:51:07: start z2qaKzYnBQHND4XND2jz3648T7RjxRhUxwmNL in docker: --network host, startHi, do you have a minimal setup of the tech stack you used that we can reproduce the issue? (you can exclude anything relevant to your business logic from that setup and put things on github, so that we can do quick investigate)
yes, i sent you the repo in a DM. thank you.