I am not sure why I am getting this error, I have debugged complete project and haven't find any dependency path issue, Please help me why this issue is appearing.

I guess it's the issue with "polymer-cli": "^1.5.4", it seems to work with "polymer-cli": "0.18.2"
Hmm, are you calling the CLI from your gulp-file directly? Can you try running with --verbose to see if there's anything concerning in that output?
'use strict';
const gulp = require('gulp');
const plugins = require('gulp-load-plugins')();
const gulpSequence = require('gulp-sequence');
var dev = process.argv.indexOf('--dist') < 0;
// -----------------------------------------------------------------------------
// getTask() loads external gulp task script functions by filename
// -----------------------------------------------------------------------------
function getTask(task) {
return require('./tasks/' + task)(gulp, plugins);
}
// -----------------------------------------------------------------------------
// Task: Compile : Scripts, Sass, EJS, All
// -----------------------------------------------------------------------------
gulp.task('compile:index', getTask('compile.index'));
// gulp.task('compile:sass', getTask('compile.sass'));
gulp.task('compile:all', ['compile:index']);
// -----------------------------------------------------------------------------
// Task: Compile : Vulcanize, vulanize app & views prior to deployment
// -----------------------------------------------------------------------------
gulp.task('compile:build', getTask('compile.build'));
// -----------------------------------------------------------------------------
// Task: Dist : Copy source files for deploy to dist/
// -----------------------------------------------------------------------------
gulp.task('dist:copy', getTask('dist.copy'));
// -----------------------------------------------------------------------------
// Task: Dist : Clean 'dist/'' folder
// -----------------------------------------------------------------------------
gulp.task('dist:clean', getTask('dist.clean'));
// -----------------------------------------------------------------------------
// Task: Dist (Build app ready for deployment)
// -----------------------------------------------------------------------------
gulp.task('dist', function (cb) {
gulpSequence('compile:all', 'dist:clean', 'compile:build', 'dist:copy')(cb);
});
{
"entrypoint": "index.html",
"shell": "src/my-app.html",
"fragments": [
"src/views/apm-configuration.html",
"src/views/bulk-loader.html",
"src/views/configure-alerts-page.html",
"src/views/edge-admin.html",
"src/views/em-admin-dialog.html",
"src/views/measurements.html",
"src/views/profiles-page.html",
"src/views/schedule-container.html",
"src/views/timeout-page.html",
"src/views/view404.html"
],
"sources": [
"src//",
"images//",
"data//",
"bower.json"
],
"extraDependencies": [
"bower_components/px-typography-design//",
"bower_components/cu-styling//",
"bower_components/cse-styling//",
"bower_components/cse-dropdown-menu//",
"bower_components/cu-color-styles//",
"bower_components/cu-typography-styles/*/",
"bower_components/webcomponentsjs/webcomponents-lite.min.js"
],
"builds": [
{
"bundle": true,
"js": {
"minify": true
},
"html": {
"minify": true
}
}
]
}
I have the same issue but with the main Polymer file. Using Polymer 1.5.5.
Tried running with --verbose which provides no other information that helps with the issue.
Error Message:
error: Promise rejection: AssertionError: Trying to save already-saved file part "C:\jspoly1\sams_client\bower_components\polymer\polymer.html_script_0.js".
error: AssertionError: Trying to save already-saved file part "C:\jspoly1\sams_client\bower_components\polymer\polymer.html_script_0.js".
at Console.assert (console.js:95:23)
at SplitFile.setPartContent (C:\Users\Jon\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\html-splitter.js:121:17)
at HtmlRejoinTransform._transformIter_2 (C:\Users\Jon\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\html-splitter.js:229:40)
at next (native)
at resume (C:\Users\Jon\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\html-splitter.js:34:44)
at fulfill (C:\Users\Jon\AppData\Roaming\npm\node_modules\polymer-cli\node_modules\polymer-build\lib\html-splitter.js:36:31)
at process._tickCallback (internal/process/next_tick.js:109:7)
Moved back to version 1.3.1 of Polymer-Cli and issue has disappeared. Not sure if that helps to resolve issue.
Moving back to 1.3.1 also worked for me. Would love to know why this is an issue in 1.5.4
Have the same issue on 1.5.7
nfo: Clearing build\ directory...
error: Promise rejection: AssertionError [ERR_ASSERTION]: Trying to save already-saved file part "{cut}\bower_components\iron-location\iron-location.html_script_0.js".
error: AssertionError [ERR_ASSERTION]: Trying to save already-saved file part "{cut}\bower_components\iron-location\iron-location.html_script_0.js".
at Console.assert (console.js:188:23)
at SplitFile.setPartContent ({cut}\AppData\Roamingnpmnode_modules\polymer-clinode_modules\polymer-build\lib\html-splitter.js:121:17)
at HtmlRejoinTransform._transformIter_2 ({cut}\AppData\Roamingnpmnode_modules\polymer-clinode_modules\polymer-build\lib\html-splitter.js:229:40)
at _transformIter_2.next (
at resume ({cut}\AppData\Roamingnpmnode_modules\polymer-clinode_modules\polymer-build\lib\html-splitter.js:34:44)
at fulfill ({cut}\AppData\Roamingnpmnode_modules\polymer-clinode_modules\polymer-build\lib\html-splitter.js:36:31)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
I am able to resolve this issue by removing "fragments" from polymer.json
Polymer CLI version = 1.5.7
"fragments":[
"xx.html"
],
I am also having this problem. I tried rolling back to 1.3.1 and 0.18.3 and had the same error, but the process failed on different files.
This log is from 1.7.3

Deleting the fragments didn't effect the build.
My polymer.json file reads as:
```{
"entrypoint": "index.html",
"shell": "src/shop-app.html",
"fragments": [
"src/lazy-resources.html"
],
"sources": [
"src//",
"data//",
"images/*/",
"bower.json"
],
"extraDependencies": [
"manifest.json",
"bower_components/webcomponentsjs/webcomponents-lite.js"
],
"lint": {
"rules": ["polymer-2-hybrid"]
},
"builds": [
{
"name": "bundled",
"bundle": true,
"js": {"minify": true},
"css": {"minify": true},
"html": {"minify": true}
},{
"name": "unbundled",
"js": {"minify": true},
"css": {"minify": true},
"html": {"minify": true}
}
]
}
I also tried the newer build settings:
"builds": [
{ "preset": "es5-bundled" },
{ "preset": "es6-unbundled" }
]
Why is this issue closed ? Still having problems with polymer-cli > 1.5.4 !!!
Polymer/NPM is always suggesting to update to 1.8.0, but as soon as it has version > 1.5.4, it will not build anymore and exits with same error codes:
"Promise rejection: AssertionError [ERR_ASSERTION]: Trying to save already-saved file part ...."
@CajunDust That error is caused by loading a resource from 2 or more different paths.
e.g.
From el-1.html
<link rel="import" href="../bower_components/paper-input/paper-input.html">
From el-2.html
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
If you are using Atom as a code editor try using the autocomplete-modules package to find inconsistencies in your code.
Same issue here with 1.6.0. Cannot find any inconsistencies in the imports. Any progress/ideas on this issue? We have a scheduled nightly build and it sometimes occurs, so race condition?
This is imo still not resolved. We had to use a specific combination of polymer-cli, bower and npm...
Also checked all the imports, and have no inconsistencies there....
For our build, it always happens
I resolved this for my project by correcting the path for some of the imports in a few different files. The path was "../../[PathToImport]" when in fact it should be "../[PathToImport]". Hope this helps, as I was thrown for a loop for quite some time, such a silly little thing!!!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.