Tools: polymer-build breaks if the project path has spaces

Created on 5 Jan 2017  Â·  15Comments  Â·  Source: Polymer/tools

Description


polymer-build breaks if the project path has spaces.

Versions & Environment

  • polymer-build: v0.6.0-alpha.3
  • node: v6.0.0
  • Operating System: macOS Sierra v10.12.2

Steps to Reproduce

Using the last Polycast example:
https://github.com/Polymer/polycasts/tree/master/ep60-firebase-build

Download the project in a path with spaces. Example: ~/folder name/project-name

npm install
bower install
npm run build

Expected Results

The build work.

Actual Results

The build doesn't work.

screen shot 2017-01-05 at 16 54 23

If I rename the ~/folder name/project-name to ~/folder-name/project-name it works.

build

Most helpful comment

Yep, it's fixed! :)

All 15 comments

Huh... well that's strange...

@abdonrd Can you turn off bundling in the gulpfile and see if this is still happening? If its fixed, then this is a problem in the old analyzer which will be resolved once vulcanize moves to the new one. If not, then I'll move this to polymer-analyzer.

/cc @rictic

@FredKSchott oh, right! It works if I comment the next line (gulpfile.js#L65):

// buildStream = buildStream.pipe(polymerProject.bundler);

Before comment:

ep60-firebase-build npm run build

> [email protected] build /Users/abdonrd/Desktop/folder name/ep60-firebase-build
> gulp

[20:02:49] Using gulpfile ~/Desktop/folder name/ep60-firebase-build/gulpfile.js
[20:02:49] Starting 'default'...
Deleting build/ directory...
Analyzing build dependencies...
[20:02:52] The following tasks did not complete: default
[20:02:52] Did you forget to signal async completion?
/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:240
                            throw _iteratorError2;
                            ^

Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:152:17)
    at PassThrough.Readable.push (_stream_readable.js:130:10)
    at PassThrough.Transform.push (_stream_transform.js:128:32)
    at BuildAnalyzer.pushDependency (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/polymer-build/lib/analyzer.js:340:34)
    at StreamLoader.load (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/polymer-build/lib/analyzer.js:389:23)
    at StreamLoader.accept (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/polymer-build/lib/analyzer.js:409:18)
    at FileLoader.request (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/loader/file-loader.js:64:27)
    at Analyzer.load (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:401:25)

npm ERR! Darwin 16.3.0
npm ERR! argv "/Users/abdonrd/.nvm/versions/node/v6.0.0/bin/node" "/Users/abdonrd/.nvm/versions/node/v6.0.0/bin/npm" "run" "build"
npm ERR! node v6.0.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-project package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs my-project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls my-project
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/abdonrd/Desktop/folder name/ep60-firebase-build/npm-debug.log

After comment:

ep60-firebase-build npm run build

> [email protected] build /Users/abdonrd/Desktop/folder name/ep60-firebase-build
> gulp

[19:58:06] Using gulpfile ~/Desktop/folder name/ep60-firebase-build/gulpfile.js
[19:58:06] Starting 'default'...
Deleting build/ directory...
Analyzing build dependencies...
Build complete!
[19:58:08] Finished 'default' after 2.59 s

Ah okay then this should be going away soon. In the mean time, you'll just have to stop bundling or stop using a non-spacey folder. Would be happy to review a PR to fix this as well.

/cc @usergenic

@FredKSchott in this code hydrolysis-1.x/src/analyzer.ts#L348:

var resolvedUrl = url.resolve(baseUri, linkurl);

First iteration:

  • baseUri: /Users/abdonrd/Desktop/folder name/ep60-firebase-build/public/my-app.html
  • linkurl: bower_components/polymer/polymer.html
  • resolvedUrl: /Users/abdonrd/Desktop/folder%20name/ep60-firebase-build/public/bower_components/polymer/polymer.html

The problem is the %20?

With the new v0.7.0 the output is:

$ yarn run build

yarn run v0.19.1
$ gulp
[00:12:41] Using gulpfile ~/Desktop/folder name/ep60-firebase-build/gulpfile.js
[00:12:41] Starting 'default'...
Deleting build directory...
Analyzing build dependencies...
[00:12:46] The following tasks did not complete: default
[00:12:46] Did you forget to signal async completion?
✨  Done in 4.14s.

curious, is your gulpfile using bundler? If so, can you remove the bundler and re-run to see if it still silently fails?

Yes, it's the same issue with the same project.

But with the new version the output is different.

v0.6.0:

$ gulp
[20:02:49] Using gulpfile ~/Desktop/folder name/ep60-firebase-build/gulpfile.js
[20:02:49] Starting 'default'...
Deleting build/ directory...
Analyzing build dependencies...
[20:02:52] The following tasks did not complete: default
[20:02:52] Did you forget to signal async completion?
/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:240
                            throw _iteratorError2;
                            ^

Error: stream.push() after EOF
    at readableAddChunk (_stream_readable.js:152:17)
    at PassThrough.Readable.push (_stream_readable.js:130:10)
    at PassThrough.Transform.push (_stream_transform.js:128:32)
    at BuildAnalyzer.pushDependency (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/polymer-build/lib/analyzer.js:340:34)
    at StreamLoader.load (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/polymer-build/lib/analyzer.js:389:23)
    at StreamLoader.accept (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/polymer-build/lib/analyzer.js:409:18)
    at FileLoader.request (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/loader/file-loader.js:64:27)
    at Analyzer.load (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:121:32)
    at Analyzer._getDependencies (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:433:25)
    at Analyzer._dependenciesLoadedFor (/Users/abdonrd/Desktop/folder name/ep60-firebase-build/node_modules/hydrolysis/lib/analyzer.js:401:25)

npm ERR! Darwin 16.3.0
npm ERR! argv "/Users/abdonrd/.nvm/versions/node/v6.0.0/bin/node" "/Users/abdonrd/.nvm/versions/node/v6.0.0/bin/npm" "run" "build"
npm ERR! node v6.0.0
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-project package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs my-project
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls my-project
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/abdonrd/Desktop/folder name/ep60-firebase-build/npm-debug.log

v0.7.0:

$ gulp
[00:12:41] Using gulpfile ~/Desktop/folder name/ep60-firebase-build/gulpfile.js
[00:12:41] Starting 'default'...
Deleting build directory...
Analyzing build dependencies...
[00:12:46] The following tasks did not complete: default
[00:12:46] Did you forget to signal async completion?
✨  Done in 4.14s.

Okay I tracked this into Vulcanize. vulcanize.process() never calls its callback, not even with an error object.

Given that polymer-bundler is right around the corner we'll focus on fixing this bug there. But we would gladly accept a pull request to vulcanize though if anyone reading would like to keep digging.

This looks like the same symptom I saw in my repro for 88.

@tony19 do you have spaces in your file path? We've traced this issue back to that as a cause.

@FredKSchott Nope, no spaces.

My machine:

/Users/tony/src/polymer/polymer-build-issue-88

Travis:

/home/travis/build/tony19-sandbox/polymer-build-issue-88

Wow... @FredKSchott you update some dependencies under semver?

Right now, with the same polymer-build#v0.6.0-alpha.3 is working. 😮 ✨

screen shot 2017-02-15 at 10 38 03

@abdonrd This should have been fixed in v0.8.0, can you confirm?

not sure about v0.6.0-alpha, maybe that was before the issue was introduced.

Yep, it's fixed! :)

Woo!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Westbrook picture Westbrook  Â·  4Comments

rictic picture rictic  Â·  3Comments

lpellegr picture lpellegr  Â·  4Comments

manolo picture manolo  Â·  4Comments

emilbillberg picture emilbillberg  Â·  3Comments