Microbundle: (babel plugin) TypeError: path.isClassPrivateMethod is not a function

Created on 3 Dec 2018  ·  11Comments  ·  Source: developit/microbundle

As soon I run microbundle build I get this error.

TypeError: path.isClassPrivateMethod is not a function
    at verifyUsedFeatures (node_modules/microbundle/node_modules/@babel/helper-create-class-features-plugin/lib/features.js:46:12)

I'm running it from a sub-folder of a monorepo, I'm not sure if that may be related. The monorepo root uses react-styleguidist and create-react-app 2.0

upstream

All 11 comments

I believe this is a babel versioning issue. I was able to resolve it when I encountered it locally by wiping node_modules and reinstalling.

Hi @FezVrasta - can you paste the output of this?

npm ls @babel/plugin-proposal-class-properties

Thanks for the reply, I deleted all the node_modules and reinstalled everything but I still get the same error.

Here's the output of npm ls:

❯ npm ls @babel/plugin-proposal-class-properties
[email protected] ui/packages/emotion-button
└── (empty)

If I install microbundle on the root directory of the monorepo it works just fine. (I need to call it with ../../node_modules/.bin/microbundle)

It also works fine if I install it on the root, and on the packages/emotion-button folder 🤷‍♂️ (in this case I can just use microbundle)

it might be conflicting with another version of the same package from another dependency

have you tried installing with yarn? (had this problem before and npm handles it badly in some cases)

I'm using Yarn already, microbundle seems to be resolved to a single version (0.8.3) according to the yarn.lock file

I don't mean microbunle, the babel plugin might be

also did you run npm ls after installing it? because it won't output anything if you delete node_modules first

Yes I ran it after installing.

@babel/plugin-proposal-class-properties (according to yarn.lock) is required only by [email protected] and [email protected], both of them require the version 7.1.0

This error also occurs in a non-microbundle project when updating @babel/plugin-proposal-class-properties to 7.2.0: badges/shields#2449.

And… looks like it's been fixed in 7.2.1: babel/babel#9120 badges/shields#2455

Fixed in Babel.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

skipjack picture skipjack  ·  11Comments

aaronjensen picture aaronjensen  ·  16Comments

developit picture developit  ·  14Comments

zzswang picture zzswang  ·  14Comments

phryneas picture phryneas  ·  12Comments