I am trying to move my code from using esri-loader to using @argic/core in Javascript 4.19. I have run these npm commands:
npm install @arcgis/core
npm install @types/arcgis-js-api@latest --save-exact
Then I updated my code with the “import … from '@arcgis/core/…;” statements and modified codes as needed. When compile, it gives me “TS6200: Definitions of the following identifiers conflict with those in another file” on
node_modules/@arcgis/core/interfaces.d.ts
node_modules/@types/arcgis-js-api/index.d.ts
So, I tried remove “arcgis-js-api” from “types” in tsconfig.app.json and tsconfig.spec.json. It now compiles.

However, when the map is being loaded, it hits a series of “TypeError: Cannot convert undefined or null to object” and gives an empty map with no layers.

Any help is appreciated. Thanks.