Skip to content

Commit

Permalink
build: fix error when running devapp on windows (#6288)
Browse files Browse the repository at this point in the history
Currently developers using Windows are not able to serve the devapp because the secondary entry-points can't be resolved. This can happen because of two things:

* `egrep`, which is an alias for `grep -E` is not part of the global `$PATH` variable on Windows
* The Regular Expression for the `grep` call is ambiguous and expects zero-width characters to be present.

This commit changes the `spawnSync` call to use `grep -E` and also changes the Regular Expression to be more explicit about what characters to match after the `from`.
  • Loading branch information
devversion authored and mmalerba committed Aug 7, 2017
1 parent 0850981 commit 509e3e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/package-tools/secondary-entry-points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export function getSecondaryEntryPointsForPackage(pkg: BuildPackage) {
buildNodes.forEach(node => {
// Look for any imports that reference this same umbrella package and get the corresponding
// BuildNode for each by looking at the import statements with grep.
node.deps = spawnSync('egrep', [
'-roh',
node.deps = spawnSync('grep', [
'-Eroh',
'--include', '*.ts',
`from.'@angular/${packageName}/.+';`,
`from '@angular/${packageName}/.+';`,
`${packageDir}/${node.name}/`
])
.stdout
Expand Down

4 comments on commit 509e3e9

@mariannafld
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

Still, running devapp on Window results:

[13:46:26] 'cdk:build:esm' errored after 928 ms
[13:46:26] TypeError: Cannot read property 'toString' of null
at F:\Work1\LearnAngular1\material2-master\tools\package-tools\secondary-entry-points.ts:42:13
at Array.forEach (native)
at Object.getSecondaryEntryPointsForPackage (F:\Work1\LearnAngular1\material2-master\tools\package-tools\secondary-entry-points.ts:38:14)
at BuildPackage.get [as secondaryEntryPoints] (F:\Work1\LearnAngular1\material2-master\tools\package-tools\build-package.ts:36:36)
at BuildPackage. (F:\Work1\LearnAngular1\material2-master\tools\package-tools\build-package.ts:59:34)
at step (F:\Work1\LearnAngular1\material2-master\tools\package-tools\build-package.ts:32:23)
at Object.next (F:\Work1\LearnAngular1\material2-master\tools\package-tools\build-package.ts:13:53)
at fulfilled (F:\Work1\LearnAngular1\material2-master\tools\package-tools\build-package.ts:4:58)
at process._tickCallback (internal/process/next_tick.js:109:7)

What can be a problem?
Thank you

@sean8544
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have the issue.

@benb7760
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mariannafld @13188888544 You can get around this issue for now by using git bash

@mariannafld
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Already working with git bash - it is works good.

Please sign in to comment.