grant / go-diagram

🌐 A UML diagram editor for Golang projects
https://docs.google.com/document/d/1exvOxiBwERKd5P1nZ7hjmhkGchoAhr0tZK_f_3EVy2M
176 stars 20 forks source link

npm run build fail with "ERROR in ./~/css-loader!./~/stylus-loader!./css/index.styl" #6

Closed shay-berman closed 7 years ago

shay-berman commented 7 years ago

I followed the setup -> https://github.com/grant/go-diagram#setup but the build failed with the following error :

echo $GOPATH/
/home/bshay/work/

#> cd ~/work/src/github.com/grant/
#> git clone https://github.com/grant/go-diagram
#> cd app
#> sudo npm i
....
....

#> npm run build

> go-diagram@0.0.2 build /home/bshay/work/src/github.com/grant/go-diagram/app
> webpack --config webpack.config.js --progress --colors -p

Hash: 9fd681efc5c08dcc4202  
Version: webpack 1.14.0
Time: 22545ms
       Asset       Size  Chunks             Chunk Names
js/bundle.js     547 kB       0  [emitted]  main
  index.html  399 bytes          [emitted]  
   [0] multi main 52 bytes {0} [built]
    + 519 hidden modules

WARNING in js/bundle.js from UglifyJs
Condition always true [./~/react/lib/ReactMount.js:764,0]
Side effects in initialization of unused variable components [./~/babel-preset-react-hmre/~/react-transform-catch-errors/lib/index.js:13,0]
Dropping side-effect-free statement [./~/babel-preset-react-hmre/~/redbox-react/lib/index.js:309,0]
Dropping unused function _assign__ [./~/babel-preset-react-hmre/~/redbox-react/lib/index.js:300,0]
Dropping unused function _set_original__ [./~/babel-preset-react-hmre/~/redbox-react/lib/index.js:308,0]
Dropping unused function _update_operation__ [./~/babel-preset-react-hmre/~/redbox-react/lib/index.js:314,0]
Condition left of && always true [(webpack)-dev-server/~/sockjs-client/~/json3/lib/json3.js:5,0]
Condition always true [./~/react/lib/findDOMNode.js:46,0]
Condition always true [./~/react/lib/instantiateReactComponent.js:80,0]
Dropping unreachable code [./~/react/lib/shouldUpdateReactComponent.js:40,0]
Condition always true [./~/react/lib/traverseAllChildren.js:158,0]
Side effects in initialization of unused variable _reactRouter [./js/components/Struct.js:6,0]
Side effects in initialization of unused variable fieldType [./js/components/UMLDiagram.js:160,10]
Side effects in initialization of unused variable appActions [./js/components/UMLDiagram.js:9,12]
Side effects in initialization of unused variable _reactRedux [./js/components/UMLDiagram.js:10,0]
Side effects in initialization of unused variable CHANGE_PROJECT_NAME [./js/constants/AppConstants.js:9,13]
Side effects in initialization of unused variable CHANGE_OWNER_NAME [./js/constants/AppConstants.js:10,13]
Side effects in initialization of unused variable DELETE_STRUCT [./js/constants/AppConstants.js:11,13]
Side effects in initialization of unused variable CHANGE_STRUCT_NAME [./js/constants/AppConstants.js:12,13]
Side effects in initialization of unused variable CHANGE_STRUCT_FIELD_TYPE [./js/constants/AppConstants.js:13,13]
Side effects in initialization of unused variable CHANGE_STRUCT_FIELD_NAME [./js/constants/AppConstants.js:14,13]
Side effects in initialization of unused variable ADD_STRUCT_FIELD [./js/constants/AppConstants.js:15,13]
Side effects in initialization of unused variable REMOVE_STRUCT_FIELD [./js/constants/AppConstants.js:16,13]
Side effects in initialization of unused variable SET_PACKAGE_DATA [./js/constants/AppConstants.js:17,13]
Side effects in initialization of unused variable ADD_STRUCT [./js/constants/AppConstants.js:18,13]
Side effects in initialization of unused variable state [./~/react-router/lib/Link.js:106,0]
Condition always true [./~/react-router/lib/Redirect.js:49,0]
Condition always true [./js/app.js:46,4]
Side effects in initialization of unused variable dispatch [./js/components/SearchBox.js:25,10]
Side effects in initialization of unused variable projectName [./js/components/pages/HomePage.js:46,6]
Side effects in initialization of unused variable ownerName [./js/components/pages/HomePage.js:47,6]
Side effects in initialization of unused variable _reactRouter [./js/components/pages/HomePage.js:9,0]
Dropping side-effect-free statement [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:134,0]
Dropping unused function _assign__ [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:125,0]
Dropping unused function _set_original__ [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:133,0]
Dropping unused function _update_operation__ [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:139,0]
Side effects in initialization of unused variable filenameHasLoaders [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:17,0]
Side effects in initialization of unused variable isFilenameAbsolute [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:28,0]
Side effects in initialization of unused variable makeUrl [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:38,0]
Side effects in initialization of unused variable makeLinkText [./~/babel-preset-react-hmre/~/redbox-react/lib/lib.js:62,0]
Condition always true [./~/babel-preset-react-hmre/~/redbox-react/~/error-stack-parser/error-stack-parser.js:6,0]
Dropping unreachable code [./~/babel-preset-react-hmre/~/redbox-react/~/error-stack-parser/error-stack-parser.js:8,5]
Condition always true [./~/babel-preset-react-hmre/~/redbox-react/~/error-stack-parser/~/stackframe/stackframe.js:6,0]
Dropping unreachable code [./~/babel-preset-react-hmre/~/redbox-react/~/error-stack-parser/~/stackframe/stackframe.js:8,5]
Condition always true [./~/history/lib/createMemoryHistory.js:69,0]
Condition always true [./~/jquery/dist/jquery.js:9778,0]
Side effects in initialization of unused variable nextFrame [./~/react-input-autosize/lib/AutosizeInput.js:9,0]
Condition always true [./~/react-router/lib/IndexRedirect.js:49,0]
Condition always true [./~/react-router/lib/IndexRoute.js:46,0]
Condition always true [./~/react-router/lib/Route.js:50,0]
Condition always true [./~/react/lib/ReactDOMComponent.js:907,0]
Dropping side-effect-free statement [./~/react/lib/ReactEventListener.js:72,0]
Dropping unused function handleTopLevelWithPath [./~/react/lib/ReactEventListener.js:98,0]
Dropping unused variable DOCUMENT_FRAGMENT_NODE_TYPE [./~/react/lib/ReactEventListener.js:26,0]
Condition always true [./~/redux/~/symbol-observable/lib/index.js:22,1]
Dropping unreachable code [./~/redux/~/symbol-observable/lib/index.js:25,0]
Condition always false [./~/style-loader/addStyles.js:24,0]
Dropping unreachable code [./~/style-loader/addStyles.js:25,0]
Condition always true [./~/style-loader!./~/css-loader!./~/stylus-loader!./css/index.styl:10,0]
Condition always true [./~/underscore/underscore.js:48,0]
Dropping unreachable code [./~/underscore/underscore.js:54,0]
Condition always true [./~/underscore/underscore.js:1543,0]
Condition always true [(webpack)-dev-server/client?http:/localhost:3000:20,0]
Dropping unreachable code [(webpack)-dev-server/client?http:/localhost:3000:23,1]
Declarations in unreachable code! [(webpack)-dev-server/client?http:/localhost:3000:25,0]
Dropping unused function getCurrentScriptSource [(webpack)-dev-server/client?http:/localhost:3000:5,0]
Dropping unused variable scriptHost [(webpack)-dev-server/client?http:/localhost:3000:25,0]
Condition always true [(webpack)/hot/only-dev-server.js:6,0]
Dropping unreachable code [(webpack)/hot/only-dev-server.js:76,0]
Condition always true [(webpack)/~/node-libs-browser/~/url/~/punycode/punycode.js:511,0]
Dropping unreachable code [(webpack)/~/node-libs-browser/~/url/~/punycode/punycode.js:518,2]
Side effects in initialization of unused variable freeExports [(webpack)/~/node-libs-browser/~/url/~/punycode/punycode.js:5,0]
Side effects in initialization of unused variable freeModule [(webpack)/~/node-libs-browser/~/url/~/punycode/punycode.js:7,0]
Dropping unused variable key [(webpack)/~/node-libs-browser/~/url/~/punycode/punycode.js:56,0]

ERROR in ./~/css-loader!./~/stylus-loader!./css/index.styl
Module build failed: ReferenceError: Promise is not defined
    at LazyResult.async (/home/bshay/work/src/github.com/grant/go-diagram/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:227:31)
    at LazyResult.then (/home/bshay/work/src/github.com/grant/go-diagram/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:131:21)
    at processCss (/home/bshay/work/src/github.com/grant/go-diagram/app/node_modules/css-loader/lib/processCss.js:198:5)
    at Object.module.exports (/home/bshay/work/src/github.com/grant/go-diagram/app/node_modules/css-loader/lib/loader.js:24:2)
 @ ./css/index.styl 4:14-118 13:2-17:4 14:20-124
shay-berman commented 7 years ago

I downgrade the css-loader to 0.18.0 and the "npm run build" finished ok. So i close the issue but I still have an issue because when i run the

> go-diagram /home/bshay/work/src/github.com/grant/go-diagram

i get 404 in the http://localhost:8080.

i think i will open different ticket for that