Skip to content

withSentryConfig breaks Nextjs image optimization with some urls in production starting with @sentry/nextjs 7.22.0 #6401

Closed
@goguda

Description

@goguda

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which package are you using?

@sentry/nextjs

SDK Version

7.22.0

Framework Version

React 18.2.0

Link to Sentry event

No response

Steps to Reproduce

Upgrading to @sentry/nextjs 7.22.0 (and 7.23.0) breaks the Nextjs Image component optimization with some urls in production, with the server returning ""url" parameter is not allowed", even though the domain is specified in next.config.js.

It appears that withSentryConfig may be overwriting/deleting the image portion of next.config.js as if no image settings have been specified in the file. Removing withSentryConfig restores proper Image component functionality.

Tested on @sentry/nextjs 7.23.0 and 7.22.0, resolved by downgrading to 7.21.1.

Expected Result

For image settings in next.config.js to not be touched by withSentryConfig.

Actual Result

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions