https://cal.com logo
#api
Title
k

Krishna Raj

07/26/2022, 6:39 AM
👋 Hello team. I am trying to build api module inside docker and get an error like this. Am i missing a dependency module ?
Copy code
Command is: `RUN yarn workspace @calcom/api build
Copy code
Step 20/37 : RUN yarn workspace @calcom/api build
 ---> Running in bc5aa4b8127b
yarn workspace v1.22.19
yarn run v1.22.19
$ next build
warn  - You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: <https://nextjs.org/docs/messages/non-standard-node-env>
warn - axiom: Envvars not detected. If this is production please see <https://github.com/axiomhq/next-axiom> for help
warn - axiom: Sending Web Vitals to /dev/null
warn - axiom: Sending logs to console
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
<https://nextjs.org/telemetry>

info  - Linting and checking validity of types...

Failed to compile.

./pages/api/attendees/[id].ts
1:1  Error: Delete `import·type·{·NextApiRequest,·NextApiResponse·}·from·"next";⏎⏎`  prettier/prettier
5:9  Error: Replace `·schemaAttendeeEditBodyParams,·schemaAttendeeReadPublic·` with `⏎··schemaAttendeeEditBodyParams,⏎··schemaAttendeeReadPublic,⏎`  prettier/prettier
9:56  Error: Insert `t";⏎import·type·{·NextApiRequest,·NextApiResponse·}·from·"nex`  prettier/prettier
120:14  Error: Replace `.status(400)` with `⏎············.status(400)⏎············`  prettier/prettier
180:56  Error: Replace `withValidQueryIdTransformParseInt(attendeeById)` with `⏎··withValidQueryIdTransformParseInt(attendeeById)⏎`  prettier/prettier

./pages/api/attendees/index.ts
1:1  Error: Delete `import·type·{·NextApiRequest,·NextApiResponse·}·from·"next";⏎⏎`  prettier/prettier
5:9  Error: Replace `·schemaAttendeeCreateBodyParams,·schemaAttendeeReadPublic·}·from·"@lib/validations/attendee` with `⏎··schemaAttendeeCreateBodyParams,⏎··schemaAttendeeReadPublic,⏎}·from·"@lib/validations/attendee";⏎import·type·{·NextApiRequest,·NextApiResponse·}·from·"next`  prettier/prettier
24:39  Error: Replace `·schemaAttendeeReadPublic.parse(attendee)` with `⏎······schemaAttendeeReadPublic.parse(attendee)⏎····`  prettier/prettier
89:10  Error: Replace `.status(400)` with `⏎········.status(400)⏎········`  prettier/prettier
101:55  Error: Replace `.map((booking:·{·id:·number·})·=>·booking.id)` with `⏎········.map((booking:·{·id:·number·})·=>·booking.id)⏎········`  prettier/prettier

./pages/api/availabilities/[id].ts
1:1  Error: Delete `import·type·{·NextApiRequest,·NextApiResponse·}·from·"next";⏎⏎`  prettier/prettier
13:1  Error: Insert `import·type·{·NextApiRequest,·NextApiResponse·}·from·"next";⏎`  prettier/prettier
20:8  Error: Replace `.status(400)` with `⏎······.status(400)⏎······`  prettier/prettier
25:53  Error: Insert `⏎···`  prettier/prettier
57:16  Error: Replace `.status(404).json({·mess
Trying my luck here bubbling this up again 🙂
a

Agusti

07/27/2022, 5:48 PM
Hey @Krishna Raj Thanks for bringing this up, will take a look and get back at you once this is fixed, just to be sure, could you let me know your branch (is it main or prod?) in api submodule? Thanks
k

Krishna Raj

07/27/2022, 5:54 PM
@Agusti I tried few branches and few commit heads. Still no luck. Can u pls give me link to the commit in github and i will try now ?
a

Agusti

07/27/2022, 5:55 PM
Let me look into it because it seems since the latest nextjs upgrade our types extension for nextapirequest is not being taken into account and other (not prettier) type issues come up on build, will look into it and fix it ASAP. Will let you know here once this is fixed, on the meantime can you try using api with
yarn dev
instead?
k

Krishna Raj

07/27/2022, 6:00 PM
Sure, yarn dev works for me. However, I need to take this to my aws via docker in Prod. Have my self hosting licence. So would appreciate a fix sooner 🙂
thank you for getting back to me. I am a backend person and I was going nuts 🙂
a

Agusti

07/27/2022, 6:01 PM
Hey no problem, @Krishna Raj I will try to either get it fixed today, or get the latest commit/branch without breaking so you can do that instead
This was introduced on latest nextjs upgrade AFAIK, but I need to dig a little further to be sure / fix it without a downgrade
k

Krishna Raj

07/27/2022, 6:02 PM
ok. I happy to accept either solution, you folks are the experts 🙂
@zomars Hi! Do you have context and perhaps an update on this issue ?
2 Views