Skip to content

@sentry/nextjs autoInstrumentServerFunctions breaks next.js' font optimization #8320

@klaasman

Description

@klaasman

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.54.0

Framework Version

7.54.0

Link to Sentry event

No response

SDK Setup

Sentry.init({
dsn: SENTRY_DSN,
tracesSampleRate: 1.0,
});

Steps to Reproduce

Clone the following repository: https://github.com/klaasman/sentry-nextjs-font-inlining-bug

  1. npm install
  2. npm run build
  3. open ./.next/server/pages/index.html, you will see that the font-loading is inlined (search for @font-face)
  4. now open next.config.js and comment out the autoInstrumentServerFunctions line
  5. npm run build
  6. open ./.next/server/pages/index.html, you will see that the font-loading is not inlined anymore (search for @font-face)

Expected Result

I expected next.js font optimization feature to work.

Actual Result

The autoInstrumentServerFunctions somehow disables next.js' font inlining feature. This setting is turned on by default, in this repository it is turned off in the next.config.js file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions