Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in ./node_modules/react-slot-machine-gen/src/react-slot-machine.js #5

Closed
NovaTheMachine opened this issue May 2, 2022 · 3 comments
Labels
question Further information is requested

Comments

@NovaTheMachine
Copy link

Hello !

i have this error with react

`ERROR in ./node_modules/react-slot-machine-gen/src/react-slot-machine.js

Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:\Users\33624\Desktop\OZALENTOURS2.0\Machine\machine\node_modules\react-slot-machine-gen\src\react-slot-machine.js: Support for the experimental syntax 'jsx' isn't currently enabled (38:7):

36 | render() {
37 | return (

38 |


| ^
39 | );
40 | }
41 | };`

@nuxy
Copy link
Owner

nuxy commented May 5, 2022

Looks like a dependency is not installed. Please confirm the following:

$ cd ./react-slot-machine-gen
$ npm install
$ npm run build
$ npm run webpack

Which should result with the output below.


> react-slot-machine-gen@1.1.1 webpack
> node_modules/.bin/webpack-cli demo/index.js --config demo/webpack.config.js --output-path demo/assets

Hash: 6669e11d35a1f51f0e76
Version: webpack 4.43.0
Time: 1138ms
Built at: 05/04/2022 9:32:37 PM
     Asset      Size  Chunks             Chunk Names
bundle.css  1.52 KiB    main  [emitted]  main
 bundle.js     1 MiB    main  [emitted]  main
Entrypoint main = bundle.css bundle.js
[./demo/index.js] 4.73 KiB {main} [built]
[./dist/react-slot-machine.js] 3.92 KiB {main} [built]
    + 19 hidden modules
Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!node_modules/slot-machine-gen/dist/slot-machine.min.css:
    Entrypoint mini-css-extract-plugin = *
       2 modules

If this still doesn't work the issue may be environment specific.

@nuxy nuxy added the question Further information is requested label May 5, 2022
@nuxy
Copy link
Owner

nuxy commented May 7, 2022

At second glance of the error you provided above. It seems you are building the library from within your own project.

That said, make sure your project .babelrc has defined the following presets and you should be good to go.

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react"
  ]
}

Closing this issue.

@nuxy nuxy closed this as completed May 7, 2022
@darshanhande11
Copy link

@nuxy This error is still prevalent when installing react-slot-machine-gen from npm and trying to use it in a react project. I have tried both of the fixes you suggested above but the error doesn't go away. Any other fix, you might suggest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants