ninjasort / react-star-rating

[Looking for Maintainers (email me)]: A simple star rating component built with React.
MIT License
173 stars 55 forks source link

Broken module path reference after running npm upgrade #38

Open dandonahoe opened 7 years ago

dandonahoe commented 7 years ago

I've been using react-star-rating for about a year now, but this morning after an npm update npm upgrade, I get a build breaking error when starting webpack.

ERROR in ./~/react-star-rating/~/react-dom/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' /Users/[removed]/node_modules/react/lib/ReactDOM in /Users/[removed]/node_modules/react-star-rating/node_modules/react-dom
 @ ./~/react-star-rating/~/react-dom/index.js 3:17-46

I then upgraded node to v7.1.0, deleted node_modules and installed the latest version of all npm modules, but the same error persists.

My current package.json is:

{
  "name": "[removed]",
  "version": "3.0.0",
  "description": "[removed]",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "start": "webpack-dev-server --progress --inline  --hot",
    "build": "./node_modules/.bin/webpack --config webpack.config.production.js",
    "lint": "./node_modules/.bin/eslint ."
  },
  "repository": {
    "type": "git",
    "url": "[removed]"
  },
  "devDependencies": {
    "babel-core": "^6.18.2",
    "babel-eslint": "^7.1.1",
    "babel-loader": "^6.2.8",
    "babel-plugin-react-transform": "^2.0.2",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "babel-preset-react-hmre": "^1.1.1",
    "babel-preset-stage-1": "^6.16.0",
    "css": "^2.2.1",
    "css-loader": "^0.26.0",
    "eslint": "^3.10.2",
    "eslint-loader": "^1.6.1",
    "eslint-plugin-react": "^6.7.1",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^3.1.1",
    "gulp-concat": "^2.6.1",
    "gulp-exec": "^2.1.3",
    "gulp-imagemin": "^3.1.1",
    "gulp-jshint": "^2.0.4",
    "gulp-less": "^3.3.0",
    "gulp-uglify": "^2.0.0",
    "gulp-util": "^3.0.7",
    "history": "^4.4.0",
    "jshint": "^2.9.4",
    "jshint-stylish": "^2.2.1",
    "karma": "^1.3.0",
    "lodash": "^4.17.2",
    "node-sass": "^3.13.0",
    "react-transform-hmr": "^1.0.4",
    "react-transform-webpack-hmr": "^0.1.6",
    "redux-devtools": "^3.3.1",
    "redux-devtools-dock-monitor": "^1.1.1",
    "redux-devtools-log-monitor": "^1.1.1",
    "redux-diff-logger": "0.0.9",
    "redux-logger": "^2.7.4",
    "sass-loader": "^4.0.2",
    "style": "0.0.3",
    "style-loader": "^0.13.1",
    "webpack": "^1.13.3",
    "webpack-dev-server": "^1.16.2"
  },
  "dependencies": {
    "babel-runtime": "^6.18.0",
    "gulp": "^3.9.1",
    "history": "^4.4.0",
    "immutable": "^3.8.1",
    "jquery": "^3.1.1",
    "moment": "^2.16.0",
    "react": "^15.4.0",
    "react-dom": "^15.4.0",
    "react-dropzone": "^3.7.3",
    "react-modal": "^1.5.2",
    "react-progress-button": "^5.0.1",
    "react-redux": "^4.4.6",
    "react-router": "^3.0.0",
    "react-router-redux": "^4.0.7",
    "react-sanfona": "0.0.15",
    "react-select": "^1.0.0-rc.2",
    "react-star-rating": "^1.4.2",
    "react-stripe-checkout": "^2.2.5",
    "redux": "^3.6.0",
    "redux-thunk": "^2.1.0",
    "reselect": "^2.5.4",
    "superagent": "^2.3.0"
  }
}

And webpack config of

/* eslint-disable no-var */
var webpack = require('webpack');
var path    = require('path');

var outputPath = __dirname + '/www';

console.log('outputPath (' + outputPath + ')');

module.exports = {
    entry: [
        'webpack-dev-server/client?http://localhost:8080',
        'webpack/hot/dev-server',
        './react/index.jsx'
    ],
    output: {
        path: outputPath,
        filename: 'bundle.js',
        publicPath: '/static/'
    },
    resolve: {
        extensions: [
            '',
            '.js',
            '.jsx'
        ],
        alias: {
          'react': path.join(__dirname, 'node_modules', 'react')
        }
    },
    devtool: 'eval-source-map',
    plugins: [
       // new webpack.HotModuleReplacementPlugin(),
        new webpack.NoErrorsPlugin(),
        new webpack.DefinePlugin({
            'process.env': {
                'NODE_ENV': JSON.stringify('develop')
            }
        })
    ],
    module: {

        preLoaders: [{
            test: /(\.js$|\.jsx$)/,
            exclude: /node_modules/,
            loader: "eslint-loader",
        }],

        loaders: [{
            test: /\.jsx?$/,
            loaders: [
                'babel'
            ],
            include: path.join(__dirname, './react')
        }, {
            test: /\.scss$/,
            loaders: ["style-loader", "css-loader", "sass-loader"]
        }]
    },

    eslint: {
        configFile: '.eslintrc'
    },
};
agordhandas commented 7 years ago

I am getting the same issue. Any fixes or workarounds?

dandonahoe commented 7 years ago

@agordhandas Considering the last update to this repo is over a year ago, it's dead. Workaround is find another npm package.