Hi,
Maybe I'm doing something wrong, but I'm writing a github-like markdown editor and I got into this issue.
TypeError: Object prototype may only be an Object or null: undefined
It happens if I try to include a 3rd party package. (using yarn link in my main folder and yarn link @webscopeio/react-markdown-editor in demo folder)
I'm sorry if I misunderstood something, I'm pretty new to bundling OSS React components. It's my first attempt.
Do you have any idea what am I doing wrong? I've been trying for hours :/
Code is available here https://github.com/webscopeio/react-markdown-editor

You'd have to share exact steps to reproduce the problem, so I could check it. I've done this:
and everything works ok for me - I've written some markdown and it renders.
Keep in mind that microbundle doesn't use babel at the moment (I will work on it in the future).
@Andarist maybe that's the issue. So I need to manually run my files through babel and then use microbundle right?
for now - yes, I'm going to work on babel@7 support soon-ish
@Andarist please try git pull now. I've tried to import the module from the original source folder so that I could continue with the development. (sorry about that), Now I've included microbundled files directly
https://github.com/webscopeio/react-markdown-editor/blob/master/demo/src/App.js#L5
If I try to include bundled files, the error pops up. I've also run babel and it still doesn't work.
https://github.com/webscopeio/react-markdown-editor/blob/master/package.json#L19
Ill check it out when i get back home, but in the meantime could u repeat setup steps (from cloning the repo) that u go through to repro this? Id be greatful for that as it would make my life easier
@Andarist thank you for your time and effort. I'm sorry if it's something I misunderstood.
I've unlinked my current project and cloned the new repo -> I still get the same result :/
You can try --compress=false flag for now. I've narrowed this down and know what's the cause (uglifyJS bug with exporting IIFEs), gonna report it there, but for now you need to work around this unfortunately.
Reported this here
@Andarist thank you very much for your assistance.
Most helpful comment
You can try
--compress=falseflag for now. I've narrowed this down and know what's the cause (uglifyJS bug with exporting IIFEs), gonna report it there, but for now you need to work around this unfortunately.Reported this here