Closed github-mayur closed 6 years ago
Can you please post your angular.json
?
This issue is solved. Thanks
@github-mayur What was the fix for this? Even I am getting struggling with this issue. Thanks.
I am getting the same error Project 'angular-universal-course:server' does not support the 'build' target my angular.json code is
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "angular-universal-course": { "root": "", "sourceRoot": "src", "projectType": "application", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", "tsConfig": "src/tsconfig.app.json", "polyfills": "src/polyfills.ts", "assets": [ "src/assets", "src/favicon.ico" ], "styles": [ "src/styles.scss" ], "scripts": [] }, "configurations": { "production": { "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ] } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "angular-universal-course:build" }, "configurations": { "production": { "browserTarget": "angular-universal-course:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "angular-universal-course:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "karmaConfig": "./karma.conf.js", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "scripts": [], "styles": [ "src/styles.scss" ], "assets": [ "src/assets", "src/favicon.ico" ] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "src/tsconfig.app.json", "src/tsconfig.spec.json" ], "exclude": [ "/node_modules/" ] } }, "server": { "builder": "@angular-devkit/build-angular:server", "options": { "outputPath": "dist/angular-universal-course-server", "main": "src/main.server.ts", "tsConfig": "src/tsconfig.server.json" }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "sourceMap": false, "optimization": { "scripts": false, "styles": true } } } } } }, "angular-universal-course-e2e": { "root": "", "sourceRoot": "", "projectType": "application", "architect": { "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "./protractor.conf.js", "devServerTarget": "angular-universal-course:serve" } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "e2e/tsconfig.e2e.json" ], "exclude": [ "/node_modules/" ] } } } } }, "defaultProject": "angular-universal-course", "schematics": { "@schematics/angular:component": { "prefix": "", "styleext": "scss" }, "@schematics/angular:directive": { "prefix": "" } } } please suggest me where I am doing wrong....Thanks..
@github-mayur what is the solution of this error, I am also facing same issue. it will be great help if you can elaborate little about your solution . Thanks
@github-mayur how did you fix it?
@kuldeeps1ngh, @FrozenPandaz , @vishwapratap , @github-mayur , @TousifMir
Apparently when you run ng add for universal in nx it might not have added the appropriate targets in "architect" of your angular.json
I created a normal universal project and then copied the missing targets from the new projects angular.json to my current project and editing the path values to match the app in question.
Image of the old projects "architect" section for the app in question.
Image of the new projects "architect" section for the app in question
I had to add "apps" to the path for npm run serve:ssr command in package.json too i.e. "dist/apps/frontend-project".
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Hello, I am working on Angular 6 and trying to build application Server Side Rendering from several days.
I am continuously facing an error as below
Since, my project name is 'frontend' and I am executing commands like below, after following full document describe on Angular Universal url
I was able to do this and successfully run server side rendering on Angular 5. But it is not working on Angular 6 and I have followed the changes done in Angular 6 too.
Is that any issue in Angular 6?