Skip to content

Server-only config is not isolated from client bundles #9

Description

@dotsdl

Problem

config.ts exports a single config object with lazy getters for both client-side (apiBaseUrl) and server-only (awsS3Bucket) values. If any client-side code path accidentally imports and accesses config.awsS3Bucket, it throws because AWS_S3_BUCKET is not exposed to the browser.

The getter is publicly exported with no guard, making this a latent error.

Suggested fix

Split server-only config into a separate file (e.g., config.server.ts) and add import 'server-only' at the top to get a build-time error if it's ever imported in a client component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions