astoiccoder / gatsby-plugin-google-gtag-cookieconsent

Out of the box solution for google gtag with cookieconsent
MIT License
0 stars 0 forks source link

Got error: Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration. #2

Open a-bochilo opened 1 month ago

a-bochilo commented 1 month ago

Got this error right after plugin was added. I removed all private # symbols from ast.js file and it started to work in dev. But obviously it won't work in prod. Solution, provided in error descritpion, didn't help. "gatsby": "^5.13.6"

image

astoiccoder commented 2 weeks ago

Thanks for raising this issue @a-bochilo!

It's hard to know why you are getting this error without knowing more about your project setup. In case it would be possible to have a minimal example to reproduce it, I would be happy to have a look into it. Did you have any babel setup in your main project?

You could also try if the original plugin works for you: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-gtag - it has the same dependency on minimatch.

I assume you tried adding this plugin as well https://babeljs.io/docs/babel-plugin-transform-private-methods#usage. For what it's worth, I'm just curious if you also added the option loose: true.

Furthermore I updated the dependencies on this plugin, but I wouldn't expect this to have any implication on the error you are experiencing.