Skip to content

Environment variables are all undefined when next-plugin-preval is wrapped with @sentry/nextjs webpack plugin #42

@Vadorequest

Description

@Vadorequest

PR: https://github.com/UnlyEd/next-right-now/pull/370/files

http://localhost:8888/api/status

image

This is the expected behavior and that's what happens when not using @sentry/nextjs OR when using withNextPluginPreval as top-level wrapper.

module.exports = withNextPluginPreval(withSentryConfig(...

http://localhost:8888/api/status

image

This is what happens when using module.exports = withSentryConfig(withNextPluginPreval(...


I'm not sure what's going wrong, but it drove me crazy for an hour.
Since @sentry/nextjs explicitly stated to wrap all webpack config, I assumed it would be safe and didn't notice the regression right away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions