Skip to content

strapi ts:generate-types fails when JWT_SECRET env is missing #24766

@minht11

Description

@minht11

Node Version

24.11.0

NPM/Yarn/PNPM Version

PNPM 10.20.0

Strapi Version

5.30.0

Operating System

MacOS

Database

PostgreSQL

Javascript or Typescript

Typescript

Reproduction URL

n/a

Bug Description

When no JWT_SECRET/ADMIN_JWT_SECRET are present running strapi ts:generate-types will cause error:

Error: Missing admin.auth.secret configuration. The SessionManager requires a JWT secret

Steps to Reproduce

  1. Remove JWT_SECRET/ADMIN_JWT_SECRET.
  2. Run strapi ts:generate-types
  3. Observe error.

Expected Behavior

No error.

Logs

Code Snippets

No response

Media

No response

Additional information

This is a regression, the last version I tested ~5.20 I don't believe had this issue. This problematic because in CI environments, code check step you might not have specific environment and I don't see reason why it is JWT is needed for types generation.

Confirmation Checklist

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