nomcopter / react-mosaic

A React tiling window manager

Home Page:https://nomcopter.github.io/react-mosaic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support ESM module

himself65 opened this issue · comments

Server Error
Error: require() of ES Module /Users/himself65/Code/textea-sheet/node_modules/react-dnd/dist/index.js from /Users/himself65/Code/textea-sheet/node_modules/react-dnd-preview/dist/cjs/usePreview.js not supported.
Instead change the require of index.js in /Users/himself65/Code/textea-sheet/node_modules/react-dnd-preview/dist/cjs/usePreview.js to a dynamic import() which is available in all CommonJS modules.

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.<anonymous>
.../node_modules/react-dnd-preview/dist/cjs/usePreview.js (8:17)
Object.<anonymous>
.../node_modules/react-dnd-preview/dist/cjs/Preview.js (12:20)
Object.<anonymous>
.../node_modules/react-dnd-preview/dist/cjs/index.js (26:16)
Object.<anonymous>
.../node_modules/react-mosaic-component/node_modules/react-dnd-multi-backend/dist/cjs/components/Preview.js (20:48)
Object.<anonymous>
.../node_modules/react-mosaic-component/node_modules/react-dnd-multi-backend/dist/cjs/index.js (56:16)
Object.<anonymous>
...node_modules/react-mosaic-component/lib/Mosaic.js (39:49)
Object.<anonymous>
.../node_modules/react-mosaic-component/lib/index.js (20:16)
react-mosaic-component
.../app/.next/server/pages/sheet/[id].js (1330:18)
__webpack_require__
.../app/.next/server/webpack-runtime.js (33:42)
__webpack_require__.t
.../app/.next/server/webpack-runtime.js (139:38)

I've created PR to address this