roylee0704 / react-flexbox-grid

A set of React components implementing flexboxgrid with the power of CSS Modules.
http://roylee0704.github.io/react-flexbox-grid/
2.93k stars 206 forks source link

Build fails with 1.1.5 #135

Closed liogate closed 7 years ago

liogate commented 7 years ago

Hi @roylee0704,

I'm trying to build my project and I got the same error related to issue #112 but with a newest version.

× Webpack compiler encountered errors.
7.4ff56ffb94d58b9c82e7.js from UglifyJs
Unexpected token: operator (>) [./~/react-flexbox-grid/src/createProps.js:5,0][7.4ff56ffb94d58b9c82e7.js:1576,17]
× Compiler encountered errors. Error: Webpack compiler encountered errors

Can you help me resolving this issue please ?

My project is based on https://github.com/davezuko/react-redux-starter-kit and material-ui 19.*

Here is my package.json

{
  "name": "react-redux-starter-kit",
  "version": "3.0.1",
  "description": "Get started with React, Redux, and React-Router!",
  "main": "index.js",
  "scripts": {
    "clean": "rimraf dist",
    "compile": "node build/scripts/compile",
    "build": "npm run clean && cross-env NODE_ENV=production npm run compile",
    "start": "cross-env NODE_ENV=development node build/scripts/start",
    "test": "cross-env NODE_ENV=test karma start build/karma.config",
    "test:watch": "npm test -- --watch",
    "lint": "eslint .",
    "lint:fix": "npm run lint -- --fix",
    "serve": "cross-env NODE_ENV=production node build/scripts/start"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/davezuko/react-redux-starter-kit.git"
  },
  "author": "David Zukowski <david@zuko.me> (http://zuko.me)",
  "license": "MIT",
  "dependencies": {
    "axios": "^0.16.1",
    "bootstrap": "^4.0.0-alpha",
    "compression": "^1.6.2",
    "express": "^4.14.0",
    "highcharts": "^5.0.14",
    "immutability-helper": "^2.3.1",
    "immutable": "^3.8.1",
    "intl-locales-supported": "^1.0.0",
    "material-ui": "^0.19.0",
    "material-ui-chip-input": "^0.17.0",
    "moment": "^2.18.1",
    "object-assign": "^4.1.1",
    "promise": "^7.1.1",
    "prop-types": "^15.5.10",
    "react": "^15.5.4",
    "react-dnd": "^2.4.0",
    "react-dnd-html5-backend": "^2.4.1",
    "react-dom": "^15.0.0",
    "react-dropzone": "^3.13.2",
    "react-flexbox-grid": "^1.1.5",
    "react-particles-js": "^1.5.0",
    "react-redux": "^5.0.4",
    "react-router": "^3.0.0",
    "react-router-redux": "^4.0.8",
    "react-table": "^6.5.3",
    "reactjs-mappletooltip": "^1.4.63",
    "redbox-react": "^1.3.6",
    "redux": "^3.6.0",
    "redux-thunk": "^2.2.0",
    "whatwg-fetch": "^2.0.3"
  },
  "devDependencies": {
    "babel-core": "^6.24.1",
    "babel-eslint": "^7.2.3",
    "babel-loader": "^7.0.0",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.15.0",
    "babel-preset-env": "^1.4.0",
    "babel-preset-react": "^6.24.1",
    "babel-runtime": "^6.20.0",
    "chai": "^3.5.0",
    "chai-as-promised": "^6.0.0",
    "chai-enzyme": "^0.6.1",
    "chalk": "^1.1.3",
    "codecov": "^2.2.0",
    "connect-history-api-fallback": "^1.3.0",
    "cross-env": "^5.0.0",
    "css-loader": "^0.28.4",
    "dirty-chai": "^1.2.2",
    "enzyme": "^2.8.2",
    "eslint": "^3.19.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-config-standard-react": "^5.0.0",
    "eslint-plugin-babel": "^4.1.1",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-node": "^4.2.2",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-react": "^7.0.1",
    "eslint-plugin-standard": "^3.0.1",
    "extract-text-webpack-plugin": "^2.1.0",
    "figures": "^2.0.0",
    "file-loader": "^0.11.1",
    "fs-extra": "^3.0.1",
    "html-webpack-plugin": "^2.24.1",
    "karma": "^1.7.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^1.1.1",
    "karma-mocha": "^1.3.0",
    "karma-mocha-reporter": "^2.2.1",
    "karma-phantomjs-launcher": "^1.0.4",
    "karma-webpack-with-fast-source-maps": "^1.10.0",
    "mocha": "^3.2.0",
    "node-sass": "^4.5.3",
    "phantomjs-prebuilt": "^2.1.14",
    "react-addons-test-utils": "^15.5.1",
    "react-test-renderer": "^15.5.4",
    "redux-mock-store": "^1.2.3",
    "rimraf": "^2.6.1",
    "sass-loader": "^6.0.5",
    "sinon": "^2.2.0",
    "sinon-chai": "^2.10.0",
    "style-loader": "^0.18.2",
    "url-loader": "^0.5.8",
    "webpack": "^2.5.1",
    "webpack-dev-middleware": "^1.8.4",
    "webpack-hot-middleware": "^2.13.2",
    "yargs": "^8.0.1"
  }
}

Here is my webpack config: https://github.com/davezuko/react-redux-starter-kit/blob/master/build/webpack.config.js

Thanks in advance !

danny-andrews commented 7 years ago

It looks like it's trying to use the script located under the src directory. It should be using the ones under lib. Can you show me what the import looks like in your code for react-flexbox-grid?

liogate commented 7 years ago

Thank you for your feed back.

import { Grid, Row, Col } from 'react-flexbox-grid'

image

danny-andrews commented 7 years ago

Hmmm...yes, that seems correct. It just seems like it's not respecting the main entry in react-flexbox-grid's package.json.

I pulled down https://github.com/davezuko/react-redux-starter-kit and added react-flexbox-grid@1.1.5 and I'm not seeing this error. Is there any way you can push your project up so I can see your exact config? (The one you linked to is the default.) That is, assuming you've made changes to it.

danny-andrews commented 7 years ago

Might be related to https://github.com/roylee0704/react-flexbox-grid/issues/26#issuecomment-195837092.

liogate commented 7 years ago

I'm sorry, this is my bad. I have checked all my source code and I found a file with this import causing the build error.

import Grid from 'react-flexbox-grid/src/components/Grid'

This is an auto-completion import made by my IDE (WebStorm) Build is now working. Thanks for your help !

danny-andrews commented 7 years ago

Ha, WebStorm's at it again. Glad to hear you got things working!