What is broken here?

It all worked before I updated my os and dev environment. Now I get so many error messages. One example. I added a property to environment:

export const environment = {
  production: false,

  baseUrl: 'https://my_server/api1'
};

when I enter the line

console.log(`baseurl = ${environment.baseUrl}`);

baseUrl can be completed! But when I press build I get the error:

error TS2339: Property 'baseUrl' does not exist on type '{ production: boolean; }

???

My basic setup
Windows 11
NodeJS 18.14
VS Code 1.75.1
Extensions Ionic, Angular Language Service
npm 9.3.1
alle packages updated

ionic start testapp blank --type=angular --capacitor

Hello…

In the folder environments

Are two types…
environment.prod.ts - when your build the production
environment.ts - when is development

See your put the baseUrl in rigth place…

Put the code in both :slight_smile:

1 Like

I may have never run build after inserting the variable, but always just ionic serve to see if my app was running in the browser. The app is far from finished, but had to leave it for several weeks and also forgot things again.