couds / react-bulma-components

React components for Bulma framework
MIT License
1.2k stars 126 forks source link

Failed to compile CRA #281

Closed semivori closed 3 years ago

semivori commented 4 years ago

npm run start gives error:

SyntaxError: myApp\node_modules\react-bulma-components\src\components\box\box.js: Support for the experimental syntax 'jsx' isn't currently enabled (9:3):

   8 | const Box = ({ children, className, ...props }) => (
>  9 |   <Element {...props} className={classnames('box', className)}>
     |   ^
  10 |     {children}
  11 |   </Element>
  12 | );

Add @babel/plugin-transform-react-jsx (https://git.io/vb4yd) to the 'plugins' section of your Babel config to enable transformation.

Versions

couds commented 4 years ago

Hi @semivori

Can you change the import from src to lib

import Box from 'react-bulma-components\lib\components\box'
semivori commented 4 years ago

@couds it gives next error

./node_modules/react-bulma-components/lib/components/box/box.sass (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-5-4!./node_modules/react-bulma-components/lib/components/box/box.sass)
SassError: File to import not found or unreadable: _variables.sass.
        on line 3 of node_modules/react-bulma-components/lib/components/utils.sass
        from line 1 of D:\Projects\tman\node_modules\react-bulma-components\lib\components\box\box.sass
>> @import "_variables.sass";
couds commented 4 years ago

Did you follow the instructions here?

https://github.com/couds/react-bulma-components#cra

semivori commented 4 years ago

@couds I have no jsconfig.json file in the project. Can you please tell me where it should be? And what should it contain besides "compilerOptions"?

kennethnym commented 3 years ago

@semivori it should be at the root of your project.

couds commented 3 years ago

@semivori I'm closing this, if you are still having this issue feel free to reopen it =)