using version 4.3.3
00:03:11.325 [14:32:56] Starting 'wct:local'...
00:03:12.239 Received {"global":{"statements":100,"branches":100,"lines":100,"functions":100}}
00:03:13.468 Installing and starting Selenium server for local browsers
00:03:18.775 Selenium server running on port 44707
00:03:18.801 [14:33:04] 'wct:local' errored after 7.47 s
00:03:18.801 [14:33:04] Error: express.use is not a function
Polymer 1.6
wct 4.3.3
Hm, I'm having trouble reproducing. What project are you testing? Does that project have a local install of wct at ./node_modules/web-component-tester?
@justinfagnani I suspect this is another bug with resolving the library in the binary. I think we should probably just stop doing that. If people want that behavior they should use npm scripts or similar to deliberately run the local version. resolve is too magical.
hey guys, we are having similar error failed on our Travis build 10 hours ago.
[19:59:24] 'wct:sauce' errored after 597 ms
[19:59:24] Error: express.use is not a function
FYI when I lock down to this version, it works:
"web-component-tester": "4.0.3",
This was introduced in 4.3.3, works fine with 4.3.1.
Reproduced on Mac OS X, wct is installed locally and running through npm scripts.
Interesting. So it occurs with both local wct and wct-st. The integration tests are passing, and our travis build passes: https://travis-ci.org/PolymerElements/app-route/builds/154516607
@kienpham2000 can you link to your failing travis build? Does the associated project use express?
@web-padawan you are right, we were locking our wct version at ^4.0.3 so it will be upgraded to latest 4.3.3. We removed the ^ and lock it at 4.0.3 and our Travis build is passing now
@rictic it's a Polymer repo, so no express at all.
Our .travis.yml config file:
env:
global:
- SAUCE_USERNAME=zzz
- SAUCE_ACCESS_KEY=zzz
addons:
sauce_connect: true
The Travis log:
Starting Sauce Connect
38.07s$ travis_start_sauce_connect
Using temp dir /tmp/sc.oU0z
/tmp/sc.oU0z ~/build/myapp
Downloading Sauce Connect
--2016-08-24 19:58:44-- http://saucelabs.com/downloads/sc-4.3.16-linux.tar.gz
Resolving saucelabs.com (saucelabs.com)... 162.222.75.243
Connecting to saucelabs.com (saucelabs.com)|162.222.75.243|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3624036 (3.5M) [binary/octet-stream]
Saving to: `sc-4.3.16-linux.tar.gz'
100%[======================================>] 3,624,036 295K/s in 14s
2016-08-24 19:58:58 (250 KB/s) - `sc-4.3.16-linux.tar.gz' saved [3624036/3624036]
Extracting Sauce Connect
Waiting for Sauce Connect readyfile
24 Aug 19:58:58 - Sauce Connect 4.3.16, build 2396 39e807b
24 Aug 19:58:58 - Using CA certificate bundle /etc/ssl/certs/ca-certificates.crt.
24 Aug 19:58:58 - Using CA certificate verify path /etc/ssl/certs.
24 Aug 19:58:58 - Starting up; pid 4184
24 Aug 19:58:58 - Command line arguments: sc-4.3.16-linux//bin/sc -i 103.1 -f sauce-connect-ready-16091 -l /home/travis/sauce-connect.log
24 Aug 19:58:58 - Log file: /home/travis/sauce-connect.log
24 Aug 19:58:58 - Pid file: /tmp/sc_client_103.1.pid
24 Aug 19:58:58 - Timezone: UTC GMT offset: 0h
24 Aug 19:58:58 - Using no proxy for connecting to Sauce Labs REST API.
24 Aug 19:58:58 - Resolving saucelabs.com to 162.222.75.243 took 14 ms.
24 Aug 19:58:58 - ***********************************************************
24 Aug 19:58:58 - A newer version of Sauce Connect (build 2818) is available!
24 Aug 19:58:58 - Download it here:
24 Aug 19:58:58 - https://saucelabs.com/downloads/sc-4.4.0-rc2-linux.tar.gz
24 Aug 19:58:58 - ***********************************************************
24 Aug 19:58:58 - Started scproxy on port 47363.
24 Aug 19:58:58 - Please wait for 'you may start your tests' to start your tests.
24 Aug 19:58:58 - Starting secure remote tunnel VM...
24 Aug 19:59:05 - Secure remote tunnel VM provisioned.
24 Aug 19:59:05 - Tunnel ID: xxx
24 Aug 19:59:05 - Secure remote tunnel VM is now: booting
24 Aug 19:59:20 - Secure remote tunnel VM is now: running
24 Aug 19:59:20 - Using no proxy for connecting to tunnel VM.
24 Aug 19:59:20 - Resolving tunnel hostname to 162.222.77.7 took 64ms.
24 Aug 19:59:20 - Starting Selenium listener...
24 Aug 19:59:20 - Establishing secure TLS connection to tunnel...
24 Aug 19:59:20 - Selenium listener started on port 4445.
24 Aug 19:59:21 - Sauce Connect is up, you may start your tests.
~/build/myapp
2.12s$ gulp wct:sauce
[19:59:23] Using gulpfile ~/build/myapp/gulpfile.js
[19:59:23] Starting 'wct:sauce'...
Received undefined
[19:59:24] 'wct:sauce' errored after 597 ms
[19:59:24] Error: express.use is not a function
The command "gulp wct:sauce" exited with 1.
sauce_connect.stop
Stopping Sauce Connect
6.02s$ travis_stop_sauce_connect
24 Aug 19:59:24 - Waiting for graceful Sauce Connect shutdown
Got signal 15
24 Aug 19:59:24 - Cleaning up.
24 Aug 19:59:24 - Removing tunnel ef0321e6bbde4906a0a4839e712512fc.
Waiting for graceful Sauce Connect shutdown
Waiting for graceful Sauce Connect shutdown
Waiting for graceful Sauce Connect shutdown
Waiting for graceful Sauce Connect shutdown
24 Aug 19:59:28 - All jobs using tunnel have finished.
24 Aug 19:59:28 - Waiting for the connection to terminate...
Waiting for graceful Sauce Connect shutdown
24 Aug 19:59:29 - Connection closed (8).
24 Aug 19:59:29 - Goodbye.
Sauce Connect shutdown complete
Done. Your build exited with 1.
@kienpham2000 does your app use express? What does npm ls | grep express show?
@rictic it's a Polymer repo, all frontend stuff. But using your command, it does show express:
$ npm ls | grep express
โ โ โโโฌ [email protected]
npmโ โ โ โ โ โ โ โ โ โโโฌ [email protected]
ERR! peer dep missing: eslint-plugin-react@^4.0.0, required by [email protected]
โ โโโฌ [email protected]
Yeah, two very different versions of express. I suspect that our use of resolve in the wct binary is messing things up. Unsure why this would be new, but I don't see what else would do it.
Would you (or someone else who's hitting this issue) mind cloning wct, checking out the no-resolve branch, installing and testing to see if it resolves the issue?
Pulled down no-resolve branch and still happening.
โโโ @types/[email protected] extraneous
โ โ โโโฌ [email protected]
โ โ โ โโโฌ [email protected]
โ โโโ [email protected] extraneous](url)
[10:58:36] 'wct:local' errored after 2.17 s
[10:58:36] Error: express.use is not a function
10:58:36.629 INFO - Shutting down...
@rictic any updates on this?
Reproduced with the following config:
Selenium server running on port 39362
TypeError: express.use is not a function
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "testAllWithoutCoverage"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
The problem is Context.emitHook is designed to support hooks which are Promises and hooks which use callbacks.
Context.emitHook only binds arguments if arguments.length > 2. webserver.ts emits the prepare:webserver hook with only one argument, which is the Express middleware. Because in this case arguments.length > 2 resoves to false, the argment isn't bound.
M preference is to remove the callback hook option and enforce all hooks to use Promises, solution here: https://github.com/AdamKorczynski/web-component-tester/tree/bug/373/removeCallback
But that breaks the wct-sauce plugin which uses callbacks.
Instead, I've submitted a PR with an empty callback added to the prepare:webserver emitHook and incuded a unit test which makes the behavior explicit.
If neither solution is suitable, it will at least point you to the right place.
Submitted PR https://github.com/Polymer/web-component-tester/pull/399
have this problem with 5.0.0
sudo wct --skip-selenium-install
Received undefined
Starting Selenium server for local browsers
Selenium server running on port 61343TypeError: express.use is not a function
npm ERR! Test failed. See above for more details.
How is the status on this? It is an important fix to get istanbul for code coverage running.
I'm taking a look at @AdamKorczynski 's PR to fix this
Yeahhh.
I confirm this issue stil can be reproduced with istanbul plugin. Here is the row causing it.
Without using that plugin, all seems to work fine with wct-local 2.0.13 on my Mac and Win 7 as well.
Ping @justinfagnani
Should we open the issue for web-component-tester-istanbul?
Still have to use 4.3.1 to get coverage working.
web-component-tester-istanbul could definitely work around the issue.
I looked at @AdamKorczynski's PR ( https://github.com/Polymer/web-component-tester/pull/399 ) and felt there was a more fundamental fix, I'll ping him there as well.
Scratch that, I fixed this in https://github.com/Polymer/web-component-tester/pull/445
Most helpful comment
Scratch that, I fixed this in https://github.com/Polymer/web-component-tester/pull/445