glide-data-grid: [Next.js] Using TypeScript enum outside of dynamic component causes styled.div is not a function

We get the TypeError: styled.div is not a function when using the GridCellKind enum outside of the dynamic component in Next.js.

I understand why we need to dynamically import DataEditor in Next.js but is there a way to import the enum’s independently from the React code?

The work around for us is to copy the enum(s) from the data-grid-types.d.ts and put them in our code directly to prevent the TypeError.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

Alpha 5 is rolling now with a fix for that build error

If you want to go the extra mile, modify the next-js project test in this repo to reproduce this on the 5.0.0 branch so I never break this again 😃