nextjs - 💡(How to fix) Fix Turbopack loader options false positive [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85735Fetched 2026-04-08 02:14:06
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×1issue_type_added ×1labeled ×1subscribed ×1

Error Message

I got error I should not see this error, because passing options to loaders are allowed

Root Cause

I should not see this error, because passing options to loaders are allowed

Code Example

Invalid next.config.ts options detected: 
Unrecognized key(s) in object: 'options' at "turbopack.rules.*.component.svg[0]"
See more info here: https://nextjs.org/docs/messages/invalid-next-config

---

Invalid next.config.ts options detected: 
Unrecognized key(s) in object: 'options' at "turbopack.rules.*.component.svg[0]"

---

// node_modules/next/dist/server/config-shared.d.ts
options?: TurbopackLoaderOptions | undefined

---

const nextConfig: NextConfig = {
    turbopack: {
    rules: {
      '*.component.svg': [
        {
          loaders: ['@svgr/webpack'],
          as: '*.js',
          // why its unknown?
          options: {
            svgo: false,
          },
        },
      ],
    },
  },
};

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.11.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Git-I985/next-turbopack-loader-options-false-positive

To Reproduce

  1. Install deps
  2. Run npm run build
  3. See
 ⚠ Invalid next.config.ts options detected: 
 ⚠     Unrecognized key(s) in object: 'options' at "turbopack.rules.*.component.svg[0]"
 ⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config

Current vs. Expected behavior

Current

I got error

 ⚠ Invalid next.config.ts options detected: 
 ⚠     Unrecognized key(s) in object: 'options' at "turbopack.rules.*.component.svg[0]"

Expected

I should not see this error, because passing options to loaders are allowed

// node_modules/next/dist/server/config-shared.d.ts
options?: TurbopackLoaderOptions | undefined
const nextConfig: NextConfig = {
    turbopack: {
    rules: {
      '*.component.svg': [
        {
          loaders: ['@svgr/webpack'],
          as: '*.js',
          // why its unknown?
          options: {
            svgo: false,
          },
        },
      ],
    },
  },
};

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.11.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Linting, Not sure

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

No response

extent analysis

TL;DR

The issue can likely be resolved by updating the @types/next package to ensure compatibility with the latest next version.

Guidance

  • Verify that the @types/next version is compatible with the installed next version (16.0.1) by running npm install @types/next@latest or npm install @types/[email protected].
  • Check the next.config.ts file for any potential typos or incorrect configurations that might be causing the error.
  • Review the turbopack.rules configuration to ensure that the options property is correctly defined and supported by the @svgr/webpack loader.
  • If the issue persists, try to isolate the problem by commenting out parts of the next.config.ts file and rebuilding the project.

Example

No code snippet is provided as the issue seems to be related to configuration and version compatibility rather than a specific code error.

Notes

The issue might be caused by a version mismatch between next and @types/next, or by an incorrect configuration in the next.config.ts file. Further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Update @types/next to the latest version to ensure compatibility with next 16.0.1, as this might resolve the configuration validation error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING