sjdemartini / mui-tiptap

A Material UI (MUI) styled WYSIWYG rich text editor, using Tiptap
MIT License
320 stars 44 forks source link

Don't use ".." import path internally to fix ESM import error #137

Closed sjdemartini closed 1 year ago

sjdemartini commented 1 year ago

Despite things working well in an external environment dev server with Vite, running Vitest against it revealed this error:

TypeError: Cannot read properties of undefined (reading 'BUBBLE_MENU')
 ❯ node_modules/mui-tiptap/dist/esm/controls/MenuButtonColorPicker.js:44:49

 ❯ node_modules/mui-tiptap/dist/esm/controls/index.js:29:188
 ❯ node_modules/mui-tiptap/dist/esm/index.js:24:210

Seems due to the fact that these new component files were using import paths of ".." and not more targeted file-specific import paths, and so perhaps can't be resolved properly in ESM contexts.