Hey there! I鈥檝e been trying to setup <cal.com>, bu...
# general
l
Hey there! I鈥檝e been trying to setup cal.com, but I keep running into the same issue. Which is running out of memory.
Copy code
@calcom/web:build: <--- Last few GCs --->
@calcom/web:build: 
@calcom/web:build: [44501:0x4fcf6d0]   117157 ms: Mark-sweep (reduce) 990.5 (1008.6) -> 989.7 (1008.6) MB, 1712.7 / 0.0 ms  (average mu = 0.137, current mu = 0.011) allocation failure scavenge might not succeed
@calcom/web:build: [44501:0x4fcf6d0]   118985 ms: Mark-sweep (reduce) 991.0 (1008.8) -> 990.3 (1009.3) MB, 1415.0 / 0.0 ms  (+ 3.0 ms in 4 steps since start of marking, biggest step 1.0 ms, walltime since start of marking 1458 ms) (average mu = 0.181, current mu = 0.224) al
@calcom/web:build: 
@calcom/web:build: <--- JS stacktrace --->
@calcom/web:build: 
@calcom/web:build: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
@calcom/web:build:  1: 0xb0a860 node::Abort() [/root/.nvm/versions/node/v16.16.0/bin/node]
I tried using
export NODE_OPTIONS...
, i tried adding the flag to
node_modules/.bin/turbo
, i tried adding the flag to
package.json
, but nothing works. Anyone who has bee running into this issue and has a solution?
d
Try using node version 14.17 instead of v16.16.0
From the Readme:
Copy code
Here is what you need to be able to run Cal.

- Node.js (Version: >=14.x <15)
Make sure to clear out any cached packages and node_modules after switching to v14.
l
Thanks! That was it!
馃憦 1
m
@Demetri M funny enough, I would get that heap out of memory error even with 14.x. I had to bump to 16.x myself to fix a problem with prisma not finding my env variables. The latest readme says they support (Version: >=14.x <17)
馃憤 1
(Of course, I would just run a yarn build a second time, and usually would be fine because other stuff was already compiled)
f
Hi there, I am having the same issue. I have tried to use node 14.17 but it throws me the following error: error next-axiom@0.10.0: The engine "node" is incompatible with this module. Expected version ">=15". Got "14.17.6" I have tried to use v15 but the error still appears. @zomars do you know what can I do for this? This is my dockerfile: Dockerfile;
Copy code
FROM node:14.17 as builder

RUN mkdir -p /app

WORKDIR /app
ARG NEXTAUTH_SECRET=secret
ARG CALENDSO_ENCRYPTION_KEY=secret
ARG NEXTAUTH_URL='<http://localhost:3000>'
ARG MAX_OLD_SPACE_SIZE=4096

ENV NEXTAUTH_SECRET=${NEXTAUTH_SECRET} \
    CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY}

COPY package.json yarn.lock turbo.json ./
COPY packages ./packages
COPY apps/web ./apps/web


RUN yarn global add turbo && \
    yarn config set network-timeout 1000000000 -g && \
    turbo prune --scope=@calcom/web --docker && \
    yarn --global-folder /tmp/yarn/ install

#RUN yarn turbo run build --filter=@calcom/web
#RUN next build

FROM node:14.17 as runner

WORKDIR /app

ARG NEXT_PUBLIC_WEBAPP_URL=<https://scheduling.hrbotfactory.com>

ENV NODE_ENV production

RUN apt-get update && \
    apt-get -y install netcat && \
    rm -rf /var/lib/apt/lists/* && \
    npm install --global prisma

COPY package.json yarn.lock turbo.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/apps/web ./apps/web
COPY --from=builder /app/packages/prisma/schema.prisma ./prisma/schema.prisma
COPY scripts scripts

RUN scripts/replace-placeholder.sh <http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER> ${NEXT_PUBLIC_WEBAPP_URL}

RUN chmod 777 -R /app/node_modules/.cache/*
RUN chmod 777 -R /app/node_modules/.cache/turbo

COPY .env ./
COPY .env.example ./
COPY .env.appStore.example ./

EXPOSE 3000

CMD ["/app/scripts/start.sh"]
z
Can you try posting this in #docker @Fernando S谩nchez