unlayer / react-email-editor

Drag-n-Drop Email Editor Component for React.js
https://unlayer.com/embed
MIT License
4.53k stars 730 forks source link

published build default export still broken #325

Closed Sam-Apostel closed 1 year ago

Sam-Apostel commented 1 year ago

referencing https://github.com/unlayer/react-email-editor/pull/321

The latest build is still broken as the TSDX builder is not working.

The example website uses the source files instead of the bundled files.

From /dist/react-email-editor-cjs.development.js:232:1: exports.default = EmailEditor;

Looking at the source code we expect exports.EmailEditor = EmailEditor;

This is also broken in the production build (1:440) And the esm build (225:1)

the typescript bindings are correct and match the source code.

When using react-email-editor in a project, running the dev server works but once built, the default export from 'react-email-editor' contains an object with the component on it's default prop.

import EmailEditor from 'react-email-editor';
console.log(EmailEditor)

/* console result running dev server
{
    $$typeof: Symbol(react.forward_ref),
    render: f(props, ref)
}
*/

/* console result after build
{
    "default": {
        $$typeof: Symbol(react.forward_ref),
        render: f(props, ref)
    },
    __esModule: true
}
*/

My PR'ed fix worked but the merged PR doesn't fix the issue: https://github.com/unlayer/react-email-editor/pull/322

lucasbesen commented 1 year ago

@Sam-Apostel can you confirm if this PR solves your problem?