Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.
This repository was archived by the owner on Oct 29, 2025. It is now read-only.

@calcom/web:build: Error: Please set NEXTAUTH_SECRET #129

Closed

Description

@GlitchWitch

After working past #121 I am running into a new issue.

Despite setting NEXTAUTH_SECRET in the .env file using a key generated from openssl rand -base64 32 the build process fails at the following using the docker repo as of commit 76f812d and the main repo as of 1c89afc.

$ docker compose up -d database
[+] Running 1/1
 ⠿ Container calcom-docker-database-1  Started                                                      0.4s

$ DOCKER_BUILDKIT=0 docker compose build calcom

[...]

@calcom/embed-react:build: warning package.json: No license field
@calcom/embed-react:build: $ tsc --emitDeclarationOnly --declarationDir dist
@calcom/web:build: cache miss, executing a5e43aa0a1de03f2
@calcom/web:build: $ next build
@calcom/web:build: error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
@calcom/web:build: 
@calcom/web:build: > Build error occurred
@calcom/web:build: Error: Please set NEXTAUTH_SECRET
@calcom/web:build:     at Object.<anonymous> (/calcom/apps/web/next.config.js:16:41)
@calcom/web:build:     at Module._compile (internal/modules/cjs/loader.js:1085:14)
@calcom/web:build:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
@calcom/web:build:     at Module.load (internal/modules/cjs/loader.js:950:32)
@calcom/web:build:     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
@calcom/web:build:     at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
@calcom/web:build:     at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
@calcom/web:build:     at async Loader.import (internal/modules/esm/loader.js:178:24)
@calcom/web:build:     at async Object.loadConfig [as default] (/calcom/node_modules/next/dist/server/config.js:68:36)
@calcom/web:build:     at async Span.traceAsyncFn (/calcom/node_modules/next/dist/trace/trace.js:79:20)
@calcom/web:build: error Command failed with exit code 1.
@calcom/web:build: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@calcom/web:build: Error: command finished with error: command (apps/web) yarn run build exited (1)

 Tasks:    4 successful, 5 total
Cached:    0 cached, 5 totalcommand (apps/web) yarn run build exited (1)

  Time:    15.318s 

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 build' returned a non-zero code: 1, Code: 1
$

Full log available here.

Activity

  1. GlitchWitch commented on Jun 4, 2022

    @GlitchWitch
    ContributorAuthor

    Potentially related to the following commit to the main repo from yesterday 10edc1f

  2. krumware commented on Jun 4, 2022

    @krumware
    Contributor

    It looks like nextauth_secret was added to the base build requirements. @zomars can you confirm?

  3. zomars commented on Jun 4, 2022

    @zomars
    Contributor

    Yes @krumware it is now a next-auth v4 requirement.

  4. krumware commented on Jun 4, 2022

    @krumware
    Contributor

    @GlitchWitch you should be able to follow the dockerfile and add the variable to the arg and env steps, then also add the equivalent to the docker-compose args section as well.

    Otherwise we'll get that added as soon as possible

  5. agustif commented on Jun 4, 2022

    @agustif

    Just a random note, I had a weird issue when openssl rand -base64 32 would generate strings containing \ backslashes, which wouldn't work nicely, make sure your string is only alphanumeric if possible.

  6. Software-Design commented on Jun 6, 2022

    @Software-Design

    If anyone else is searching for a "quick and dirty" solution until there is an update available:

    Modifying the Dockerfile and adding the missing environment variables manually is a quick way to get it running for the moment:

    ENV NEXT_PUBLIC_WEBAPP_URL=$NEXT_PUBLIC_WEBAPP_URL \
        NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL \
        NEXT_PUBLIC_LICENSE_CONSENT=$NEXT_PUBLIC_LICENSE_CONSENT \
        NEXT_PUBLIC_TELEMETRY_KEY=$NEXT_PUBLIC_TELEMETRY_KEY \
        DATABASE_URL=$DATABASE_URL \
        NEXTAUTH_SECRET=<some-secret> \
        CALENDSO_ENCRYPTION_KEY=<some-other-secret
    ```>
    
  7. krumware commented on Jun 22, 2022

    @krumware
    Contributor

    This should now be resolved, please see updated instructions!

  8. gianlucagilardi commented on Jun 24, 2022

    @gianlucagilardi

    After working past #121 I am running into a new issue.

    Sorry to hijack the thread but since I am struggling with the stack network missing error may I ask you how you solved the issue at hand?

    Thanks a lot!

    G.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions