turbopack.ignoreIssue

Suppress specific Turbopack errors and warnings from the CLI output and error overlay.

The turbopack.ignoreIssue option allows you to filter out specific Turbopack errors and warnings so they do not appear in the CLI output or the error overlay. This is useful for suppressing known warnings that do not affect your application, such as intentionally unresolved optional dependencies.

This option is only available when using Turbopack (next dev --turbopack).

Usage

import type { NextConfig } from 'next'
 
const nextConfig: NextConfig = {
  turbopack: {
    ignoreIssue: [
      {
        path: '**/vendor/**',
      },
    ],
  },
}
 
export default nextConfig

Options

Each rule in the ignoreIssue array is an object with the following fields:

FieldTypeRequiredDescription
pathstring | RegExpYesMatches against the file path of the issue
titlestring | RegExpNoMatches against the issue title
descriptionstring | RegExpNoMatches against the issue description

An issue is suppressed when it matches the path and all other specified fields in a rule. If only path is provided, any issue from a matching file is suppressed.

Good to know: Issue titles and descriptions may change between Turbopack versions. The path field is generally stable, but is not guaranteed to remain consistent for all issue types. When possible, prefer using more specific path patterns over title or description matching.

path

A glob pattern (when a string) or regular expression that matches against the file path where the issue originated.

next.config.js
module.exports = {
  turbopack: {
    ignoreIssue: [
      // Glob pattern: suppress issues from any file under vendor/
      { path: '**/vendor/**' },
      // RegExp: suppress issues from files matching a pattern
      { path: /node_modules\/legacy-lib/ },
    ],
  },
}

title

An exact string match (when a string) or regular expression that matches against the issue title.

next.config.js
module.exports = {
  turbopack: {
    ignoreIssue: [
      {
        path: '**/src/**',
        title: 'Module not found',
      },
    ],
  },
}

description

An exact string match (when a string) or regular expression that matches against the issue description.

next.config.js
module.exports = {
  turbopack: {
    ignoreIssue: [
      {
        path: '**/src/**',
        description: /Cannot find module 'optional-dep'/,
      },
    ],
  },
}

Examples

Suppressing warnings for optional dependencies

If your code uses try/catch around an optional require() call, Turbopack may report a "Module not found" warning. You can suppress it:

import type { NextConfig } from 'next'
 
const nextConfig: NextConfig = {
  turbopack: {
    ignoreIssue: [
      {
        path: '**/lib/optional-feature/**',
        title: 'Module not found',
      },
    ],
  },
}
 
export default nextConfig

Combining multiple rules

You can specify multiple rules to suppress different issues:

next.config.js
module.exports = {
  turbopack: {
    ignoreIssue: [
      { path: '**/vendor/**' },
      { path: '**/legacy/**', title: 'Module not found' },
      { path: /generated\//, description: /expected identifier/ },
    ],
  },
}

Version History

VersionChanges
v16.2.0turbopack.ignoreIssue introduced.

On this page