Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: acorn__WEBPACK_IMPORTED_MODULE_2__.Parser.extend is not a function #189

Closed
davixyz opened this issue Mar 12, 2019 · 5 comments
Closed

Comments

@davixyz
Copy link

davixyz commented Mar 12, 2019

I'm coming from this repo: https://github.com/pedronauck/docz
Which has a dependency tree like this

└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected]  deduped

Seems that [email protected] introduced an issue with this:
TypeError: acorn__WEBPACK_IMPORTED_MODULE_2__.Parser.extend is not a function

If we lock to [email protected] everything works again. Any insight?

@adrianheine
Copy link
Member

Thanks for the report! Can you link to a small example reproducing this issue? I tried the basic example from docz, but couldn't get it to work at all for me.

@davixyz
Copy link
Author

davixyz commented Mar 13, 2019

Hi @adrianheine
Here's the repo with the issue:
https://github.com/davixyz/docz-issue

Basically seems that theme-default is depending on react-live, which is depending on buble and latest version is breaking. Seems to work again when I lock [email protected]

@adrianheine
Copy link
Member

Thanks, I can reproduce the issue by cloning your repo, running npm i && npm run dev and then opening the served page in my browser. I'll have a look.

@adrianheine
Copy link
Member

Hm, acorn__WEBPACK_IMPORTED_MODULE_2__ is [email protected], but bublé depends on acorn@6. Apparently, npm did set up the dependencies correctly, since echo "const x = 1" | node_modules/.bin/buble works (I can see an [email protected] in node_modules/buble/node_modules, too). So, on the server-side, everything seems to be correctly set-up, but somehow webpack bundles bublé with the wrong acorn version.

It's obvious that [email protected] doesn't have this issue since I temporarily bundled acorn in the bublé package in that version. [email protected] also depends on an external acorn@6, so that doesn't work either, and [email protected] uses the old acorn@5, so that works with the acorn version webpack bundles it with.

I suggest to open corresponding issues with webpack (since it is doing the wrong bundling) and react-live (since it is the package depending on bublé). Further, it makes sense to update all dependencies on acorn@5, since that's a safe way to fix this issue for you and also a good thing to do for everyone. Currently, [email protected] (via [email protected] via [email protected]) and [email protected] (this can be solved by upgrading to [email protected]) pull in acorn@5.

@davixyz
Copy link
Author

davixyz commented Mar 15, 2019

If the issue is not here, we can close this.

@davixyz davixyz closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants