teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

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

Open drakonkat opened 4 years ago

drakonkat commented 4 years ago

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:

Specifications

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?

GiladShoham commented 4 years ago

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

drakonkat commented 4 years ago

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 commented 4 years ago

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

GiladShoham commented 4 years ago

@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.