Angular-cli: [6.0.0-beta.6] Project '$$proj0' could not be found in workspace when trying to build/serve

Created on 17 Mar 2018  路  11Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 6.0.0-beta.6
Node: 8.10.0
OS: win32 x64
Angular: 6.0.0-beta.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

@angular/cli: 6.0.0-beta.6
@angular-devkit/architect: 0.0.7
@angular-devkit/build-optimizer: 0.4.6
@angular-devkit/build-webpack: 0.0.7
@angular-devkit/core: 0.4.6
@angular-devkit/schematics: 0.4.6
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 6.0.0-beta.6
@schematics/angular: 0.4.6
@schematics/package-update: 0.4.6
typescript: 2.7.2
webpack: 4.1.1

Repro steps

  • Clone this repo.
  • npm i
  • Run ng build or ng build --prod

Observed behavior

Project '$$proj0' could not be found in workspace.
Error: Project '$$proj0' could not be found in workspace.
    at Architect.getTarget (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\@angular-devkit\architect\src\architect.js:101:19)
    at MergeMapSubscriber.architect.loadWorkspaceFromJson.pipe.operators_1.concatMap [as project] (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\@angular\cli\models\architect-command.js:56:45)
    at MergeMapSubscriber._tryNext (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\operators\mergeMap.js:122:27)
    at MergeMapSubscriber._next (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\operators\mergeMap.js:112:18)
    at MergeMapSubscriber.Subscriber.next (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\Subscriber.js:90:18)
    at MergeMapSubscriber.notifyNext (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\operators\mergeMap.js:145:30)
    at InnerSubscriber._next (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\InnerSubscriber.js:23:21)
    at InnerSubscriber.Subscriber.next (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\Subscriber.js:90:18)
    at Object.subscribeToResult (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\util\subscribeToResult.js:17:25)
    at MergeMapSubscriber._innerSub (D:\www\_github\_mrcroft\ng6-cli6-app-shell\node_modules\rxjs\operators\mergeMap.js:132:38)

Mention any other details that might be useful (optional)

The app in the repo was generated with 6.0.0-beta.6, --skip-install and updated Angular to 6.0.0-beta.8 + TypeScript to required >=2.7.2
But I've also tried with Angular 5.2.9 and it behaves the same.
It has SW + AppShell because that's what I was planing on testing, but removing the app shell and the universal app doesn't change anything, so they're not the issue.

devkibuild-angular

Most helpful comment

same here after "ng update --next" to go on angular@rc0

All 11 comments

I have the same issue. I have this only only with @angular/[email protected]. Beta 5 works properly.

same here after "ng update --next" to go on angular@rc0

Temporary workaround: reducing the number of Angular CLI apps in .angular-cli.json to one, and remove its "name" property. So it obviously has to do with using multiple Angular CLI apps.

That's funny, since I added "name" to all apps because in beta.5 there was a bug that you couldn't build by id. Anyway, unfortunately if you use SSR and/or AppShell you can't actually remove them. But it's just a beta, it's only out there for us to test and file issues.

+1

Retested in 6.0.0-beta.7 and 6.0.0-beta.8:

$ ng build --app foo --prod --sourcemaps
Cannot read property 'host' of null
TypeError: Cannot read property 'host' of null
    at Architect._loadJsonFile (../node_modules/@angular-devkit/architect/src/architect.js:200:32)

where it tries to return this._workspace.host.read(). So seems to be the same issue.

This problem has apparently come back in @angular/cli": "~6.1.1. And I have also just tried 6.1.0, the same problem.

I had never got such problem in previous production releases. Now I have to reverse back to 6.0.8 which is working fine.

I had just tried 6.1.3, and the problem remains. Now I have to reverse back to 6.0.8 again which is working fine.

I had just tried 6.1.4, and the problem remains. Now I have to reverse back to 6.0.8 again and again which is working fine.

Thanks for reporting this issue. This issue was originally reported a long time ago and since then we've had many releases, one of which might have addressed this problem. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

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._

Was this page helpful?
0 / 5 - 0 ratings