0
votes

I am creating a project using polymer. It runs as it is supposed to on local server using the following command line on the terminal

polymer --serve open

But when I try building it using

polymer build

it creates a build file but with errors and inside the build folder the index.html file is not created.

The error log is as follows:

info: Building application...
info: Generating build/unbundled...
info: Generating build/bundled...
warn: Unable to uglify file /Users/ashiq/Documents/Conversations/Dashboard_new/bower_components/intl/scripts/build-data.js
warn: Unable to uglify file /Users/ashiq/Documents/Conversations/Dashboard_new/bower_components/intl/scripts/build-dist.js
warn: Unable to uglify file /Users/ashiq/Documents/Conversations/Dashboard_new/bower_components/intl/scripts/build-lib.js
error: Uncaught exception: TypeError: Cannot read property 'previous' of null
error: TypeError: Cannot read property 'previous' of null at Parser.parseDeclarationOrRuleset (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:192:63) at Parser.parseRule (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:80:21) at Parser.parseRulelist (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:153:27) at Parser.parseDeclarationOrRuleset (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:212:87) at Parser.parseRule (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:80:21) at Parser.parseRules (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:62:25) at Parser.parseStylesheet (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:55:47) at Parser.parse (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/node_modules/shady-css-parser/dist/shady-css/parser.js:51:19) at css (/usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/index.js:51:39) at /usr/local/lib/node_modules/polymer-cli/node_modules/css-slam/index.js:45:36

1
Check my answer to this questionAlan Dávalos

1 Answers

1
votes

I was seeing the same error message of "Cannot read property 'previous' of null" when using polymer build for six files. I found an error in the CSS for one of my component files. Specifically, instead of curly brackets I had used regular brackets. Once corrected, everything built correctly.

So I suggest that you examine the CSS for each component file. Probably a CSS error is stopping the build. To find the error, I went file by file and deleted the CSS until the build would work correctly. Once I had the component file that contained the bad CSS, I then deleted one line at a time until I found the error. If you CSS is long, you might try CSS lint.