I have been a lot of time trying to create my project, but, Im having a lot of errors. I fix some ones but, when I thought everything was okay, IT WASN'T. Im learning this ionic and app development stuff and I didn't thoght "oh, maybe any video on youtube shows aaaaall that" it looked easy!
Okay, this it's the error after putting the
ionic start appname sidemenu
I choosed angular, then it last a few minutes in do all their stuff, and then, when i write
ionic serve
(the first thigs were okay but then this:)
Build at: 2022-11-16T20:03:58.075Z - Hash: 87f644733fcc69d9 - Time: 32811ms
[ng]
[ng] Error: src/app/folder/folder.page.ts:10:10 - error TS2564: Property 'folder' has no initializer and is not definitely assigned in the constructor.
[ng]
[ng] 10 public folder: string;
[ng] ~~~~~~
[ng]
[ng]
[ng] Error: src/app/folder/folder.page.ts:15:5 - error TS2322: Type 'string | null' is not assignable to type 'string'.
[ng] Type 'null' is not assignable to type 'string'.
[ng]
[ng] 15 this.folder = this.activatedRoute.snapshot.paramMap.get('id');
[ng] ~~~~~~~~~~~
[ng]
[ng]
[ng]
[ng] × Failed to compile.
And the server said "cannot get" with the window name like "error"
can someone iluminate me with their knowledge?(and sorry for my english XD)
CodePudding user response:
you may need to run the command ionic build
before running ionic serve
.
CodePudding user response:
Go to tsconfig.json file and in compilerOptions
, turn off strictPropertyInitialization
and strictNullChecks
, like this:
"compilerOptions": {
"strictPropertyInitialization": false,
"strictNullChecks": false,
...
}