unlayer / react-email-editor

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

[TS] 'unlayer' was also declared here. #334

Closed PavelTankovich closed 1 year ago

PavelTankovich commented 1 year ago

When running the tsc command, I am receiving an error that is breaking my project tests.

Steps to reproduce:

Install "react-email-editor": "^1.7.8" Run the tsc command in the terminal. image

brunolemos commented 1 year ago

Unlayer's script injects a global variable called unlayer. So you should use a different name for your variable to avoid conflicts.

PavelTankovich commented 1 year ago

@brunolemos That's the problem that I don't use such a variable. The problem is in your library. Have you tried reproducing it?

brunolemos commented 1 year ago

Based on the error screenshot, it seems that the cause is that both src and dist are published to npm. Probably only dist should be published to npm. This should be fixed by https://github.com/unlayer/react-email-editor/pull/342.

brunolemos commented 1 year ago

@PavelTankovich please try brunolemos-react-email-editor@2.0.3 and let me know if it works well for you.