calcom / docker

The Docker configuration for Cal.com is an effort powered by people within the community. Cal.com, Inc. does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk.
MIT License
662 stars 344 forks source link

Build fails: "Error: terser not found. Since Vite v3, terser has become an optional dependency. You need to install it." #219

Closed saschafoerster closed 1 year ago

saschafoerster commented 1 year ago

Hi there,

the manual build fails with latest 2.6.3:

DOCKER_BUILDKIT=0 docker compose build calcom
Sending build context to Docker daemon    103MB
Step 1/33 : FROM node:16 as builder
 ---> 99a307306f72
Step 2/33 : WORKDIR /calcom
 ---> Using cache
 ---> 8c5489a5cd5f
Step 3/33 : ARG NEXT_PUBLIC_LICENSE_CONSENT
 ---> Using cache
 ---> b0925c52d3a2
Step 4/33 : ARG CALCOM_TELEMETRY_DISABLED
 ---> Using cache
 ---> 90cba49cfc72
Step 5/33 : ARG DATABASE_URL
 ---> Using cache
 ---> 4c00ec7e739d
Step 6/33 : ARG NEXTAUTH_SECRET=secret
 ---> Using cache
 ---> 4b8cacfe0f03
Step 7/33 : ARG CALENDSO_ENCRYPTION_KEY=secret
 ---> Using cache
 ---> b5f65621cfb6
Step 8/33 : ARG MAX_OLD_SPACE_SIZE=4096
 ---> Using cache
 ---> 904e2e68f87d
Step 9/33 : ENV NEXT_PUBLIC_WEBAPP_URL=http://NEXT_PUBLIC_WEBAPP_URL_PLACEHOLDER     NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT     CALCOM_TELEMETRY_DISABLED=$CALCOM_TELEMETRY_DISABLED     DATABASE_URL=$DATABASE_URL     NEXTAUTH_SECRET=${NEXTAUTH_SECRET}     CALENDSO_ENCRYPTION_KEY=${CALENDSO_ENCRYPTION_KEY}     NODE_OPTIONS=--max-old-space-size=${MAX_OLD_SPACE_SIZE}
 ---> Using cache
 ---> 56a5ebcba1ee
Step 10/33 : COPY calcom/package.json calcom/yarn.lock calcom/turbo.json calcom/git-init.sh calcom/git-setup.sh ./
 ---> Using cache
 ---> 88d6c5ca4e85
Step 11/33 : COPY calcom/apps/web ./apps/web
 ---> Using cache
 ---> 60475647ea3d
Step 12/33 : COPY calcom/packages ./packages
 ---> Using cache
 ---> 5011ee9547c9
Step 13/33 : RUN yarn global add turbo &&     yarn config set network-timeout 1000000000 -g &&     turbo prune --scope=@calcom/web --docker &&     yarn install
 ---> Using cache
 ---> 79f5091e01b7
Step 14/33 : RUN yarn turbo run build --filter=@calcom/web
 ---> Running in 2dc6cfc84db7
yarn run v1.22.19
$ /calcom/node_modules/.bin/turbo run build --filter=@calcom/web
 WARNING  cannot find a .git folder. Falling back to manual file hashing (which may be slower). If you are running this build in a pruned directory, you can ignore this message. Otherwise, please initialize a git repository in the root of your monorepo
• Packages in scope: @calcom/web
• Running build in 1 packages
@calcom/app-store-cli:build: cache bypass, force executing 3fc16c4b2536a0e8
@calcom/prisma:db-deploy: cache bypass, force executing 7ddf5303b66c8064
@calcom/embed-core:build: cache bypass, force executing c13d8524b6afed56
@calcom/prisma:post-install: cache bypass, force executing 679e19d92e53118e
@calcom/app-store-cli:build: warning package.json: No license field
@calcom/app-store-cli:build: $ ts-node --transpile-only src/build.ts
@calcom/embed-core:build: $ NEXT_PUBLIC_EMBED_FINGER_PRINT=$(git rev-parse --short HEAD) yarn __build
@calcom/prisma:post-install: $ yarn generate-schemas
@calcom/prisma:db-deploy: $ yarn prisma migrate deploy
@calcom/embed-core:build: fatal: not a git repository (or any of the parent directories): .git
@calcom/prisma:post-install: $ prisma generate && prisma format
@calcom/embed-core:build: $ yarn tailwind && vite build && tsc --emitDeclarationOnly --declarationDir dist && cp -r ../../../apps/web/public/embed ./dist/
@calcom/prisma:db-deploy: $ /calcom/node_modules/.bin/prisma migrate deploy
@calcom/embed-core:build: $ yarn tailwindcss -i ./src/styles.css -o ./src/tailwind.generated.css
@calcom/embed-core:build: $ /calcom/node_modules/.bin/tailwindcss -i ./src/styles.css -o ./src/tailwind.generated.css
@calcom/prisma:post-install: Prisma schema loaded from schema.prisma
@calcom/prisma:db-deploy: Prisma schema loaded from schema.prisma
@calcom/prisma:db-deploy: Datasource "db": PostgreSQL database "calendso", schema "public" at "database:5432"
@calcom/prisma:db-deploy: 
@calcom/prisma:db-deploy: 156 migrations found in prisma/migrations
@calcom/prisma:db-deploy: 
@calcom/prisma:db-deploy: 
@calcom/prisma:db-deploy: No pending migrations to apply.
@calcom/embed-core:build: 
@calcom/embed-core:build: Rebuilding...
@calcom/app-store-cli:build: Generated apps.metadata.generated.ts, apps.server.generated.ts, apps.browser.generated.tsx, apps.schemas.generated.ts, apps.keys-schemas.generated.ts
@calcom/embed-core:build: DEPRECATION: adding rounded classes via the variants array is deprecated. Use nocompatible mode instead (i.e. when adding the plugin, use `scrollbarPlugin({ nocompatible: true })`)
@calcom/embed-core:build: 
@calcom/embed-core:build: Done in 1042ms.
@calcom/embed-core:build: vite v4.1.2 building for production...
@calcom/embed-core:build: transforming...
@calcom/prisma:post-install: 
@calcom/prisma:post-install: ✔ Generated Prisma Client (4.8.1 | library) to ./../../node_modules/@prisma/client in 1.02s
@calcom/prisma:post-install: 
@calcom/prisma:post-install: ✔ Generated Zod Schemas (0.5.4) to ./zod in 1.56s
@calcom/prisma:post-install: You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
@calcom/prisma:post-install: ```
@calcom/prisma:post-install: import { PrismaClient } from '@prisma/client'
@calcom/prisma:post-install: const prisma = new PrismaClient()
@calcom/prisma:post-install: ```
@calcom/embed-core:build: DEPRECATION: adding rounded classes via the variants array is deprecated. Use nocompatible mode instead (i.e. when adding the plugin, use `scrollbarPlugin({ nocompatible: true })`)
@calcom/embed-core:build: ✓ 17 modules transformed.
@calcom/embed-core:build: rendering chunks...
@calcom/embed-core:build: computing gzip size...
@calcom/embed-core:build: ../../../apps/web/public/embed/preview.html                0.62 kB
@calcom/embed-core:build: ../../../apps/web/public/embed/assets/embed-d506cdf4.css  13.26 kB │ gzip: 3.48 kB
@calcom/embed-core:build: ../../../apps/web/public/embed/preview.js                  2.05 kB │ gzip: 1.07 kB
@calcom/embed-core:build: ../../../apps/web/public/embed/embed.js                   27.62 kB │ gzip: 8.17 kB
@calcom/prisma:post-install: Prisma schema loaded from schema.prisma
@calcom/prisma:post-install: Formatted /calcom/packages/prisma/schema.prisma in 330ms 🚀
@calcom/prisma:build: cache bypass, force executing 28b98843c4a885e7
@calcom/prisma:build: $ yarn prisma migrate deploy
@calcom/prisma:build: $ /calcom/node_modules/.bin/prisma migrate deploy
@calcom/prisma:build: Prisma schema loaded from schema.prisma
@calcom/prisma:build: Datasource "db": PostgreSQL database "calendso", schema "public" at "database:5432"
@calcom/prisma:build: 
@calcom/prisma:build: 156 migrations found in prisma/migrations
@calcom/prisma:build: 
@calcom/prisma:build: 
@calcom/prisma:build: No pending migrations to apply.
@calcom/prisma:build: ┌─────────────────────────────────────────────────────────┐
@calcom/prisma:build: │  Update available 4.8.1 -> 4.10.1                       │
@calcom/prisma:build: │  Run the following to update                            │
@calcom/prisma:build: │    yarn add --dev prisma@latest                         │
@calcom/prisma:build: │    yarn add @prisma/client@latest                       │
@calcom/prisma:build: └─────────────────────────────────────────────────────────┘
@calcom/embed-snippet:build: cache miss, executing 3c27f48ef222a265
@calcom/embed-snippet:build: $ vite build && tsc --emitDeclarationOnly --declarationDir dist
@calcom/embed-snippet:build: vite v4.1.2 building for production...
@calcom/embed-snippet:build: transforming...
@calcom/embed-snippet:build: ✓ 1 modules transformed.
@calcom/embed-snippet:build: rendering chunks...
@calcom/embed-snippet:build: computing gzip size...
@calcom/embed-snippet:build: dist/snippet.es.js  1.16 kB │ gzip: 0.57 kB
@calcom/embed-snippet:build: Entry module "src/index.ts" is using named and default exports together. Consumers of your bundle will have to use `snippet.default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
@calcom/embed-snippet:build: [vite:terser] terser not found. Since Vite v3, terser has become an optional dependency. You need to install it.
@calcom/embed-snippet:build: error during build:
@calcom/embed-snippet:build: Error: terser not found. Since Vite v3, terser has become an optional dependency. You need to install it.
@calcom/embed-snippet:build:     at loadTerserPath (file:///calcom/node_modules/vite/dist/node/chunks/dep-9912c491.js:13812:19)
@calcom/embed-snippet:build:     at Object.renderChunk (file:///calcom/node_modules/vite/dist/node/chunks/dep-9912c491.js:13848:32)
@calcom/embed-snippet:build:     at file:///calcom/node_modules/vite/node_modules/rollup/dist/es/shared/node-entry.js:24160:40
@calcom/embed-snippet:build:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
@calcom/embed-snippet:build: error Command failed with exit code 1.
@calcom/embed-snippet:build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@calcom/embed-snippet:build: ERROR: command finished with error: command (packages/embeds/embed-snippet) yarn run build exited (1)
command (packages/embeds/embed-snippet) yarn run build exited (1)

 Tasks:    5 successful, 6 total
Cached:    0 cached, 6 total
  Time:    20.767s 

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1 error occurred:
    * Status: The command '/bin/sh -c yarn turbo run build --filter=@calcom/web' returned a non-zero code: 1, Code: 1
saschafoerster commented 1 year ago

Duplicate of https://github.com/calcom/cal.com/issues/7277

krumware commented 1 year ago

related to https://github.com/calcom/cal.com/issues/7277 (jinx)

aasargsian commented 1 year ago

Same issue for us, blocking us

krumware commented 1 year ago

This is resolved. Please make sure to update your submodules.