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

BUG - Move config referencing out of plugin constructor #121

@mike-suggitt

Description

@mike-suggitt

In looking to use this plugin over a number of environments (particularly localhost) I need to be able to change the config based on the environment. I typically like to do this via separate files and use the ${env} to switch between them. The problem is that variable interpolation isn't performed until AFTER plugin constructors are called which means if I try to do this with serverless-nextjs-plugin then it fails due to an uninterpolated string.

This is a bug/change request to follow serverless best practice and move config access into the relevant lifecycle hooks.

Same issue encountered and discussed here -> https://forum.serverless.com/t/serverless-plugin-resolving-variable-references/2233

Serverless PR updating docs for best practice -> https://github.com/serverless/serverless/pull/3911/files

Thanks, and great work btw!! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions