envs icon indicating copy to clipboard operation
envs copied to clipboard

Support for the experimental syntax 'classProperties' isn't currently enabled

Open drakonkat opened this issue 4 years ago • 4 comments

Hi, i have imported a bit component in my reactjs project. After that i have imported the component in a render but it always give me this error:

`SyntaxError: '' Support for the experimental syntax 'classProperties' isn't currently enabled (52:11):

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation. ` To import a bit component i have followed this steps:

  • bit init
  • bit import
  • npm run start

Specifications

  • Bit version: 14.7.6
  • Node version:10.19.0
  • npm / yarn version:6.14.4
  • Platform: Windows 10, reactjs project
  • Bit compiler (include version):bit.envs/compilers/[email protected]
  • Bit tester (include version):

I have tried to add babel but in react js react-script manage everything... so i cannot change babel or webpack configuration. There is a way to use bit without eject the project from react-script?

drakonkat avatar May 13 '20 14:05 drakonkat

Do you have a compiler defined for your component? Or it's a 3rd part component? can you share a link to the component? Our official react compiler does support it. see here - https://bit.dev/bit/envs/compilers/react/~code#.babelrc

GiladShoham avatar May 14 '20 18:05 GiladShoham

Hi, Here is the component: https://bit.dev/tech4care/basiccomponents/button-group

if i import the component i will always get the same error, but i have setted the right compiler. image

And if i try to run it: image

Maybe i'm missing something?

drakonkat avatar May 19 '20 07:05 drakonkat

Hi i have another error with another component:

Link: https://bit.dev/tech4care/basiccomponents/filtered-table/

i made: bit init bit import {component}

npm run start and i get this error: image

Instead if i make npm install {component}

Everything work

drakonkat avatar Jun 04 '20 16:06 drakonkat

@drakonkat Both issues are unrelated. I'm moving this issue to the envs repo. Please open a new issue (on bit repo) about the diff between import and npm install.

GiladShoham avatar Jun 14 '20 20:06 GiladShoham