KevinVandy / material-react-table

A fully featured Material UI V5 implementation of TanStack React Table V8, written from the ground up in TypeScript
https://material-react-table.com
MIT License
1.52k stars 439 forks source link

Cannot use import statement outside a module in MRT 3.0.0 #1237

Closed pascuflow closed 1 month ago

pascuflow commented 1 month ago

material-react-table version

3.0.0

react & react-dom versions

18.3.1

Describe the bug and the steps to reproduce it

Getting this error on Nextjs 14.2.8 when upgraded from MRT 2.13.3 :


Call Stack
<unknown>
/home/Project/node_modules/ (mui/material/Unstable_TrapFocus/FocusTrap.js (4)
Next.js
mod.require
file:///home/Project/node_modules/next/dist/server/require-hook.js (65:28)
Module.patchedRequire
node_modules/require-in-the-middle/index.js (217:1)
Hook._require.Module.require
node_modules/require-in-the-middle/index.js (142:1)
Object.<anonymous>
file:///home/Project/node_modules/material-react-table/dist/index.js (57:17)

### Minimal, Reproducible Example - (Optional, but Recommended)

N/A

### Screenshots or Videos (Optional)

_No response_

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

None

### Terms

- [X] I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
bahadryalcn commented 1 month ago

try version 3.0.1. It worked on me

KevinVandy commented 1 month ago

Removed the MUI focus trap in v3.0.1 since it seems to have some module issues

pascuflow commented 1 month ago

Ok, 3.0.1 works now.

KevinVandy commented 1 month ago

Glad to hear it, guess my test projects didn't catch all cjs vs esm scenarios

KevinVandy commented 1 month ago

going to open this issue up for a day so that more people see it. Solution is to upgrade to MRT v3.0.1