lahsivjar / react-stomp

React websocket component for STOMP protocol over SockJs
https://www.npmjs.com/package/react-stomp
MIT License
135 stars 41 forks source link

issue on command - react run build #45

Closed arorakaran123 closed 6 years ago

arorakaran123 commented 6 years ago

Hi...I am new to react and I have to use react-stomp in my project. I added the dependency in my project. Now, when I run it (npm run build), It gives the following error -

65% 743/801 build modulesModuleParseError: Module parse failed: /home/.../myproject/node_modules/imports-loader/index.js?define=>false!/home/.../myproject/node_modules/stompjs/node_modules/websocket/package.json Unexpected token (5:9) You may need an appropriate loader to handle this file type. SyntaxError: Unexpected token (5:9)

Now, when I go to the file node_modules/websocket/package.json, I see the following -

{ "_from": "websocket", "_id": "websocket@1.0.26", "_inBundle": false, "_integrity": "sha512-fjcrYDPIQxpTnqFQ9JjxUQcdvR89MFAOjPBlF+vjOt49w/XW4fJknUoMz/mDIn2eK1AdslVojcaOxOqyZZV8rw==", "_location": "/websocket", "_phantomChildren": {}, "_requested": { "type": "tag", "registry": true, "raw": "websocket", "name": "websocket", "escapedName": "websocket", "rawSpec": "", "saveSpec": null, "fetchSpec": "latest" },

Line number 5 is => "_integrity": "sha512-fjcrYDPIQxpTnqFQ9JjxUQcdvR89MFAOjPBlF+vjOt49w/XW4fJknUoMz/mDIn2eK1AdslVojcaOxOqyZZV8rw==",

lahsivjar commented 6 years ago

@arorakaran123 Please share the package.json you are using for your project

arorakaran123 commented 6 years ago

package.json

{ "name": "centric", "version": "0.0.0", "description": "Centric - Bootstrap Admin App + ReactJS", "author": "@themicon_co", "scripts": { "start": "webpack-dev-server --config webpack.dev.js --inline --progress --port 3000 --open", "clean": "rimraf dist/", "build": "npm run clean && webpack --config webpack.prod.js --progress --profile --bail", "test": "echo \"Error: no test specified\" && exit 1", "install": "napa", "postinstall": "modernizr -c modernizr-config.json -d app/modernizr.js" }, "napa": { "flot": "flot/flot#v0.8.3", "jquery.flot.spline": "miloszfalinski/jquery.flot.spline", "ika.jvectormap": "kakirigi/ika.jvectormap", "nestable": "dbushell/Nestable", "sidebysideimproved": "pkoltermann/sidebysideimproved" }, "dependencies": { "animate.css": "3.5.2", "babel-polyfill": "6.16.0", "babel-runtime": "6.18.0", "blueimp-gallery": "2.21.3", "bootstrap": "3.3.7", "bootstrap-colorpicker": "2.5.1", "bootstrap-datepicker": "1.6.4", "bootstrap-filestyle": "1.2.1", "clockpicker": "0.0.7", "codemirror": "5.17.0", "compression": "1.6.2", "cross-env": "3.1.3", "d3": "4.3.0", "datamaps": "0.5.8", "datatables": "1.10.12", "dropzone": "4.3.0", "easy-pie-chart": "2.1.6", "ejs": "2.5.2", "ev-emitter": "1.0.2", "font-awesome": "4.7.0", "get-size": "2.0.2", "gmaps": "0.4.24", "imagesloaded": "4.1.1", "ionicons": "2.0.1", "jquery": "2.2.4", "jquery-bootgrid": "1.3.1", "jquery-knob": "1.2.11", "jquery-localize": "0.1.0", "jquery-sparkline": "2.4.0", "jquery-steps": "1.1.0", "jquery-validation": "1.15.1", "jquery.browser": "0.1.0", "jquery.flot.tooltip": "github:krzysu/flot.tooltip", "loaders.css": "0.1.2", "lodash": "4.16.6", "masonry-layout": "4.1.0", "material-colors": "1.1.1", "meteor-node-stubs": "0.2.0", "modernizr": "3.3.1", "moment": "2.16.0", "ng-material-floating-button": "0.6.2", "nouislider": "9.0.0", "npm": "^5.8.0", "outlayer": "2.1.0", "prop-types": "^15.6.1", "pubsub-js": "1.5.3", "range-parser": "^1.2.0", "raphael": "2.2.7", "react": "15.3.2", "react-addons-css-transition-group": "15.3.0", "react-bootstrap": "0.30.6", "react-dom": "15.2.1", "react-dropzone": "3.5.3", "react-nouislider": "1.11.0", "react-router": "3.0.0", "react-router-bootstrap": "0.23.0", "react-stomp": "^3.0.1", "rickshaw": "1.6.0", "screenfull": "3.0.2", "select2": "4.0.3", "select2-bootstrap-css": "1.4.6", "summernote": "0.8.2", "summernote-webpack-fix": "0.8.2", "sweetalert": "1.1.3", "x-editable": "1.5.1" }, "devDependencies": { "babel-core": "6.18.2", "babel-jest": "17.0.0", "babel-loader": "6.2.7", "babel-plugin-transform-runtime": "6.15.0", "babel-preset-es2015": "6.18.0", "babel-preset-react": "6.16.0", "babel-preset-stage-0": "6.16.0", "copy-webpack-plugin": "3.0.1", "css-loader": "0.25.0", "empty-module": "0.0.2", "extract-text-webpack-plugin": "1.0.1", "file-loader": "0.9.0", "html-loader": "0.4.4", "html-webpack-plugin": "2.24.1", "imports-loader": "0.6.5", "napa": "2.3.0", "node-sass": "3.11.3", "null-loader": "0.1.1", "phantomjs-prebuilt": "2.1.13", "raw-loader": "0.5.1", "react-addons-test-utils": "15.3.2", "react-hot-loader": "1.3.1", "rimraf": "2.5.4", "sass-loader": "4.0.2", "style-loader": "0.13.1", "url-loader": "0.5.7", "webpack": "1.13.3", "webpack-dev-server": "^1.16.5", "webpack-merge": "0.15.0" } }

lahsivjar commented 6 years ago

@arorakaran123 Please also share your webpack.prod.js

lahsivjar commented 6 years ago

Closed due to inactivity, repone if needed