Skip to content

Next.js 15 build failure: Module parse failed for @tanstack/react-table #5980

Open
@abdooo097

Description

@abdooo097

TanStack Table version

v8.21.2

Framework/Library version

Next.js v15.2.4

Describe the bug and the steps to reproduce it

What version of TanStack Table are you using?

@tanstack/react-table: [v8.21.2]

What version of Next.js are you using?

Next.js: 15.2.4

What is your issue?

When building a Next.js 15 project with @tanstack/react-table, the following error occurs:

Module parse failed: 'import' and 'export' may appear only with 'sourceType: module'

It seems that Next.js Webpack does not handle this package as an ESM module correctly.

Steps to Reproduce:

  1. Create a Next.js 15 project.
  2. Install @tanstack/react-table (npm install @tanstack/react-table).
  3. Use it in a component.
  4. Run npm run build.

Expected Behavior:

The build should succeed without errors.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

undefined

Screenshots or Videos (Optional)

Image

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions