_polymer serve_ works as a charm but _polymer build_ doesn't.
As mentioned, I'm using Windows 10.
The error log is:
$ polymer build
info: Building application...
info: Generating build/unbundled...
info: Generating build/bundled...
error: Uncaught exception: Error: file path is not in root: c:/polymer2/app-drawer-template-master/index.html (c:\polymer2\app-drawer-template-master)
error: Error: file path is not in root: c:/polymer2/app-drawer-template-master/index.html (c:\polymer2\app-drawer-template-master)
at StreamAnalyzer.urlFromPath (C:\Users\degroote\AppData\Roaming\npm\node_modules\polymer-cli\lib\build\analyzer.js:91:19)
I believe the issue is that the logic thinks that _c:/polymer2/app-drawer-template-master/_ is different than _c:\polymer2\app-drawer-template-master._ Note the dashes!
Also, I'm using the most recent version of the CLI downloaded through npm.
Thanks for creating the issue, @degroote22! This is a known problem that @justinfagnani is currently working on.
位 polymer build
info: Building application...
info: Generating build/unbundled...
info: Generating build/bundled...
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\marked-element\demo/index.html_script_0.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\marked-element\test/marked-element.html_script_0.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\marked-element\test/marked-element.html_script_1.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\marked-element\test/marked-element.html_script_2.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\marked-element\test/marked-element.html_script_3.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\marked-element\test/marked-element.html_script_4.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\web-component-tester\data/index.html_script_0.js
warn: Unable to uglify file C:\Users\Tobias\Documents\GitHub\wochat\bower_components\web-component-tester\data/index.html_script_2.js
info: No file found for C:\Users\Tobias\Documents\GitHub\wochat\Users\Tobias\Documents\GitHub\wochat\wochat-element.html
Thought this might be helpful. Notice the path at the bottom line, it is kind of weird. First time I tried to build, so I have not yet gotten into what might be causing the uglify warnings.
@dehrax , I also had this issue... When I updated the CLI it gave me the above error. Have you tried updating?
@degroote22 Still haven't figured it out. I ran polybuild instead...
Just in case it's helpful - the error is different if a root (polymer build --root . ) is specified.
No file found for C:\Users<...>my-app\Users<...>my-app\src\my-elem.html
vs
No file found for Users<...>my-app\src\my-elem.html
Node: 4.2.6
Polymer-CLI: 0.12.0

This should be fixed in v0.13.0. @dehrax can you try reproducing and let us know if it's still broken?
In v0.13.0, it's not "warn: Unable to uglify file" anymore...
"warn: Unable to optimize file"
@FredKSchott Not sure if I have missed something critical but now I get this
位 polymer build
info: Building application...
info: Generating build/unbundled...
info: Generating build/bundled...
error: Uncaught exception: Error: ENOENT: no such file or directory, open 'C:\Users\Tobias\Documents\GitHub\polymer\polymer.html'
error: Error: ENOENT: no such file or directory, open 'C:\Users\Tobias\Documents\GitHub\polymer\polymer.html'
at Error (native)
And I get this error with polybuild
位 polybuild wochat-element.html
ERROR finding /Users/Tobias/Documents/GitHub/polymer/polymer.html
[08:33:34] Error in plugin 'gulp-vulcanize'
Message:
ENOENT: no such file or directory, open 'C:\Users\Tobias\Documents\GitHub\polymer\polymer.html'
Details:
errno: -4058
code: ENOENT
syscall: open
path: C:\Users\Tobias\Documents\GitHub\polymer\polymer.html
fileName: C:\Users\Tobias\Documents\GitHub\wochat\wochat-element.html
Tested with this repo
@dehrax wochat is an element correct? polymer build is currently only supported for applications. If you want to see the element, you can just serve it directly via polymer serve.
@FredKSchott I was looking at integrating the component in an Ember application. It proved to be difficult, so I rewrote the entire thing as an Ember component instead.
Any tips on how to integrate Polymer components in non-Polymer applications?
We have pretty good communities over on Slack and Stack Overflow, I'd recommend asking your question there.
I'm on windows 10, running polymer build command... but it does not works and i have no idea what to do...
C:\Users\priv8\Desktop\test-client>polymer build
info: Preparing build...
info: Building application...
error: Uncaught exception: Error: file path is not in root: C:\ (C:\Users\priv8\Desktop\test-client)
error: Error: file path is not in root: C:\ (C:\Users\priv8\Desktop\test-client)
at Object.urlFromPath (C:\Users\priv8\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\path-transformers.js:41:15)
at StreamAnalyzer.addFile (C:\Users\priv8\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\analyzer.js:131:44)
at StreamAnalyzer._transform (C:\Users\priv8\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\analyzer.js:72:14)
at StreamAnalyzer.Transform._read (_stream_transform.js:167:10)
at StreamAnalyzer.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:307:12)
at writeOrBuffer (_stream_writable.js:293:5)
at StreamAnalyzer.Writable.write (_stream_writable.js:220:11)
at PassThrough.ondata (C:\Users\priv8\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\readable-stream\lib\_stream_readable.js:546:20)
at emitOne (events.js:101:20)
@LinkOut's issue was polymer.json entrypoint was / and resolved to C:\ using polymer build. Changing this to index.html instead of / solved the build issue.
It seems like there may be other issues going on in this thread though.
Most helpful comment
Thanks for creating the issue, @degroote22! This is a known problem that @justinfagnani is currently working on.