1

I'm building a new angular app and anywhere I do console.log's it comes from main.js:1 or polyfills.js:1 and not from the proper component.

"localdev": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment-localdev.ts"
}
]

"dependencies": {
"@angular/animations": "~12.1.0-",
"@angular/cdk": "^12.1.3",
"@angular/common": "~12.1.0-",
"@angular/compiler": "~12.1.0-",
"@angular/core": "~12.1.0-",
"@angular/forms": "~12.1.0-",
}
JSON Derulo
  • 9,780
  • 7
  • 39
  • 56
nani
  • 1
  • 2
  • What do you mean it comes from those files? Are you logging a trace that points to those files? – David Kidwell Jul 29 '21 at 17:51
  • Perhaps your build is not generating source maps? See this SO question: https://stackoverflow.com/questions/54879588/what-will-happen-if-sourcemap-is-set-as-false-in-angular – TotallyNewb Jul 29 '21 at 18:02
  • wrote a comment in home.component.ts, should show the same right, but it showing as main.ts.1 .. I mentioned angular version details and angulaer.json localdev config code @DKidwell – nani Jul 29 '21 at 23:47
  • sourcemap set to false in angular.json @TotallyNewb – nani Jul 29 '21 at 23:50
  • Read what source maps do. Without sourcempas you can't debug, as all you get is minified and bundled code. Enable sourcemaps for your development environment and while debugging you will be able to access the unminifed, unbundled code. – TotallyNewb Jul 30 '21 at 06:24

0 Answers0