Skip to content

[nextjs] v7.29.0 breaks reading next.config.js resulting into missing runtimeConfig #6691

Closed
@vire

Description

@vire

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.29.0

Framework Version

@sentry/[email protected]

Link to Sentry event

No response

Steps to Reproduce

  1. run yarn add -D @sentry/nextjs
  2. have a next.config.js exporting a function
const { withSentryConfig } = require('@sentry/nextjs')
// see https://nextjs.org/docs/api-reference/next.config.js/introduction
module.exports = (phase, { defaultConfig }) => {
  /**
   * @type {import('next').NextConfig}
   */
  const nextConfig = {
    /* config options here */
  }
  return withSentryConfig(defaultConfig)
}


1 .

see warns


warn  - Invalid next.config.js options detected: 
  - The root value must be an object but it was a function.

See more info here: https://nextjs.org/docs/messages/invalid-next-config
warn  - Detected next.config.js, no exported configuration found. https://nextjs.org/docs/messages/empty-configuration
info  - automatically enabled Fast Refresh for 1 custom loader
^C%              

Expected Result

the next.config.js file should be read as without errors

Actual Result

window.NEXT_DATA.runtimeConfig is missing

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