error adding build configuration

Afshar pro asked 4 months ago

I upgraded my project to mdb v6

But when i try to add configurations to angular.json, using "ng serve -c test" project served successfully but in browser i get this runtime error:

Uncaught Error: Unexpected value 'BrowserModule' imported by the module 'AppModule'. Please add a @NgModule annotation.

This is configuration of my angular.json:

"configurations": {
"production": {
"fileReplacements": [{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"test": {
"fileReplacements": [{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}],
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
}
}

 

If i execute ng serve -c test  I get the error, but executing ng serve  is ok and works. Why using test configuration leads to the specified error?


Afshar pro commented 4 months ago

I checked docs, but problem still exists.

https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/application-environments.md


Damian Gemza commented 4 months ago

Does this problem exist with a blank Angular project? Or not?


Afshar pro commented 4 months ago

@dgemza No, doesn't exist


Damian Gemza commented 4 months ago

Could you create a reproduction repository and provide me a link, or send it to me at d.gemza@mdbootstrap.com? It would help me.
Best Regards,
Damian


Please insert min. 20 characters.
Status

Open

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No