Skip to content

Custom nextjs distdir is not respected #6512

Description

@troendheim

In Nextjs it is possible to build to a customized path by setting a distDir in the next config

SST does not respect this setting and actively reads files in a hardcoded .next-folder as seen multiple times in platform/src/components/aws/nextjs.ts

The solution would be to check if that setting is set in the next.config.* and then find the route manifest etc. in the designated distDir instead of the hardcoded .next.

When this is done we're one step closer to be able to have the same Nextjs app deployed multiple times in the same sst.config.ts. Our use case is that we need to deploy the same app twice but a few different environment-variables. If they're ending up in the same distDir build artifacts will leak between them.

Related to opennextjs/opennextjs-aws#1100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions