Encountering an error in my Angular
application while running ng serve --prod
on Windows 10.
An unhandled exception occurred: Configuration 'production' is not set in the workspace.
See "C:\Users\User\AppData\Local\Temp\ng-vzzrhY\angular-errors.log" for more details.
The angular-error.log file contains the following information:
[error] Error: Configuration 'production' is not set in the workspace.
at Object.getOptions (D:\ProjectPath\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js:47:31)
at WorkspaceNodeModulesArchitectHost.getOptionsForTarget (D:\ProjectPath\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js:126:49)
...
Here is a snippet from my Angular.json
file
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"Project1": {
"projectType": "application",
"schematics": {},
...
}
},
...
},
"defaultProject": "Project1",
"cli": {
"analytics": "8062720d-180a-4964-84ea-93f7438a70dd"
}
}
Received guidance from this Stack Overflow thread but issue still persists: An unhandled exception occurred: Configuration 'production' is not set in the workspace
How can I resolve this error?