Microbundle: TypeError: Object prototype may only be an Object or null: undefined

Created on 2 Mar 2018  路  8Comments  路  Source: developit/microbundle

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

screen shot 2018-03-02 at 12 55 18

Most helpful comment

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

All 8 comments

You'd have to share exact steps to reproduce the problem, so I could check it. I've done this:

  • cloning ur repo
  • yarn install in repo
  • yarn link in repo
  • yarn install in demo
  • yarn link parent project in demo
  • yarn start in demo

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prateekbh picture prateekbh  路  17Comments

Conaclos picture Conaclos  路  11Comments

smithki picture smithki  路  19Comments

Andarist picture Andarist  路  33Comments

scttcper picture scttcper  路  11Comments