Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
abdooo097 opened this issue Mar 26, 2025 · 1 comment
Open
2 tasks done

Comments

@abdooo097
Copy link

abdooo097 commented Mar 26, 2025

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.
@KevinVandy
Copy link
Member

Don't import from src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants