Using Prisma with fastify in create-t3-turbo

I am trying to setup a project based on create-t3-turbo so that I can share my prisma configuration between my nextjs app and fastify. I have managed to get the project working locally, but when i build and run the fastify server i get the following error:
fastify:start:
fastify:start: /Users/fofer/repos/catalyst/catalyst-t3-turbo/packages/db/index.ts:1
fastify:start: import { PrismaClient } from "@prisma/client";
fastify:start: ^^^^^^
fastify:start:
fastify:start: SyntaxError: Cannot use import statement outside a module
fastify:start: at internalCompileFunction (node:internal/vm:73:18)
fastify:start:
fastify:start: /Users/fofer/repos/catalyst/catalyst-t3-turbo/packages/db/index.ts:1
fastify:start: import { PrismaClient } from "@prisma/client";
fastify:start: ^^^^^^
fastify:start:
fastify:start: SyntaxError: Cannot use import statement outside a module
fastify:start: at internalCompileFunction (node:internal/vm:73:18)
4 Replies
Zan
Zan2y ago
need to set to module in package.json
fOfer
fOferOP2y ago
would that be in the prisma package?
fOfer
fOferOP2y ago
GitHub
GitHub - fmonper1/catalyst-monorepo
Contribute to fmonper1/catalyst-monorepo development by creating an account on GitHub.
fOfer
fOferOP2y ago
this is the monorepo code I've had a look at similar setups with turborepo and fastify/express but I cant seem to find the difference https://github.com/maybemaby/fastify-next-starter/blob/main/apps/api/package.json https://github.com/The-Zagy/zagy-blog/tree/main
Want results from more Discord servers?
Add your server