cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

[CAL-1789] API package.json missing dependencies

Open krumware opened this issue 3 years ago • 1 comments

When building API standalone, it is inheriting a number of dependencies based on the availability of the web app, and currently fails to build on its own.

To reproduce, do not initialize the web submodule. This includes a number of dependencies of files in the ./lib folder, including this example: This was reached after including a missing dependency for @types/bcrypt

@calcom/api:build: info  - Linting and checking validity of types...
@calcom/api:build: Failed to compile.
@calcom/api:build: 
@calcom/api:build: ./lib/helpers/customPrisma.ts:2:19
@calcom/api:build: Type error: Could not find a declaration file for module 'memory-cache'. '/calcom/node_modules/memory-cache/index.js' implicitly has an 'any' type.
@calcom/api:build:   Try `npm i --save-dev @types/memory-cache` if it exists or add a new declaration (.d.ts) file containing `declare module 'memory-cache';`
@calcom/api:build: 
@calcom/api:build:   1 | import { hash } from "bcryptjs";
@calcom/api:build: > 2 | import cache from "memory-cache";
@calcom/api:build:     |                   ^
@calcom/api:build:   3 | import { NextMiddleware } from "next-api-middleware";
@calcom/api:build:   4 | 
@calcom/api:build:   5 | import { PRISMA_CLIENT_CACHING_TIME } from "@calcom/api/lib/constants";
@calcom/api:build: 
@calcom/api:build: > Build error occurred

Should API's package.json be updated with the appropriate dependencies, or is it expected to rely on Web's? (this is likely a monorepo strategy question to some degree)

CAL-1789

krumware avatar Oct 10 '22 19:10 krumware

@krumware what command are you using to build?

zomars avatar Oct 10 '22 23:10 zomars