Skip to content

fix(@angular/cli): fix webdriver deep import on yarn - #5057

Merged
filipesilva merged 1 commit into
angular:masterfrom
filipesilva:fix-yarn-deep-import
Feb 27, 2017
Merged

filipesilva merged 1 commit into
angular:masterfrom
filipesilva:fix-yarn-deep-import

Conversation

@filipesilva

Copy link
Copy Markdown
Contributor

Followup from #4597

Following @Meligy suggestion in #4597 (comment)

Fix #4596

@Meligy

Meligy commented Feb 27, 2017

Copy link
Copy Markdown
Contributor

Would a simple fs.existsSync (or similar) be faster than try / catch here?

@filipesilva

Copy link
Copy Markdown
Contributor Author

It would. But I kinda don't trust the require logic here very much...

The webdriver package behaves oddly in requires. Doing just require('webdriver-manager/built/lib/cmds/update') should really just work in all scenario since the package exists. But it doesn't work in npm.

So I kinda prefer to have the try-catch around them.

@filipesilva
filipesilva merged commit 97bfb12 into angular:master Feb 27, 2017
@filipesilva
filipesilva deleted the fix-yarn-deep-import branch February 27, 2017 15:32
@rolandjitsu

Copy link
Copy Markdown

Are you sure this works? I just upgraded and installed packages via yarn install and I still get:

 angular-lab@0.0.0 e2e /Users/rolandjitsu/Projects/angular-lab
> ng e2e --no-watch ---no-live-reload

** NG Live Development Server is running on http://localhost:49152 **
(node:90082) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.     
Hash: 700e7624bdecc6694c7c
Time: 14534ms
chunk    {0} 0.chunk.js, 0.chunk.js.map 43 kB {1} [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 28.1 kB {4} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 39 kB {5} [initial] [rendered]
chunk    {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 77 kB {5} [initial] [rendered]
chunk    {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.12 MB [initial] [rendered]
chunk    {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
Cannot find module 'protractor/node_modules/webdriver-manager/built/lib/cmds/update' from '/Users/rolandjitsu/Projects/angular-lab'
Error: Cannot find module 'protractor/node_modules/webdriver-manager/built/lib/cmds/update' from '/Users/rolandjitsu/Projects/angular-lab'
    at Function.module.exports [as sync] (/Users/rolandjitsu/Projects/angular-lab/node_modules/resolve/lib/sync.js:37:15)
    at Object.requireProjectModule (/Users/rolandjitsu/Projects/angular-lab/node_modules/@angular/cli/utilities/require-project-module.js:6:28)
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/@angular/cli/tasks/e2e.js:35:66
    at Class.run (/Users/rolandjitsu/Projects/angular-lab/node_modules/@angular/cli/tasks/e2e.js:16:16)
    at Compiler.rebuildCb (/Users/rolandjitsu/Projects/angular-lab/node_modules/@angular/cli/commands/e2e.js:99:48)
    at Compiler.applyPlugins (/Users/rolandjitsu/Projects/angular-lab/node_modules/tapable/lib/Tapable.js:61:14)
    at Watching._done (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:91:17)
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:74:18
    at Compiler.emitRecords (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:351:37)
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:57:19
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:344:11
    at next (/Users/rolandjitsu/Projects/angular-lab/node_modules/tapable/lib/Tapable.js:154:11)
    at Compiler.compiler.plugin (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at next (/Users/rolandjitsu/Projects/angular-lab/node_modules/tapable/lib/Tapable.js:156:14)
    at Compiler.compiler.plugin (/Users/rolandjitsu/Projects/angular-lab/node_modules/@ngtools/webpack/src/plugin.js:236:13)
    at Compiler.applyPluginsAsyncSeries1 (/Users/rolandjitsu/Projects/angular-lab/node_modules/tapable/lib/Tapable.js:158:13)
    at Compiler.afterEmit (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:341:8)
    at Compiler.<anonymous> (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:336:14)
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:359:16
    at iteratorCallback (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:935:13)
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:843:16
    at MemoryFileSystem.writeFile (/Users/rolandjitsu/Projects/angular-lab/node_modules/memory-fs/lib/MemoryFileSystem.js:328:9)
    at Compiler.writeOut (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:330:27)
    at Compiler.<anonymous> (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:312:20)
    at /Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:3025:16
    at eachOfArrayLike (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:940:9)
    at eachOf (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:990:5)
    at Object.eachLimit (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/node_modules/async/dist/async.js:3089:3)
    at Compiler.emitFiles (/Users/rolandjitsu/Projects/angular-lab/node_modules/webpack/lib/Compiler.js:301:20)
    at Immediate.<anonymous> (/Users/rolandjitsu/Projects/angular-lab/node_modules/memory-fs/lib/MemoryFileSystem.js:288:4)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)

@filipesilva

Copy link
Copy Markdown
Contributor Author

@rolandjitsu this fix isn't published yet. It will be in the next released version.

@rolandjitsu

Copy link
Copy Markdown

Ahhh ... ok. I thought it was published with the RC0 release. I just saw the timestamp on the merge 😄 Looking forward to the fix.

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this pull request Apr 12, 2017
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[beta.31] ng e2e does not work anymore

5 participants