Hi,
Created a simple react app using Create-React-App, installed the @types/arcgis-js-api following the ts setup instructions in dev portal. Continue to get Module not found: Can't resolve 'esri/Map' . Here are the import statements.
Solved! Go to Solution.
Ok, I see. That doc is for building a pure TypeScript project using the CDN. For create-react-app, you don't need to install the typings. Check out this sample here. It's not in TS, but same rules apply, you can use the default tsconfig from create-react-app and still be ok.
https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app
Are you using the AMD package arcgis-js-api or the ESM package @arcgis/core?
You don't need the typings installed separately in either case, they’ll come with the packages. I'm curious what your package.json and project looks like that you need the typings?
Hey, thanks for the response. I should have mentioned that this is a typescript react app. I basically was just following this from your documentation since I am just getting started with your js sdk.
https://developers.arcgis.com/javascript/latest/typescript-setup/
If its fine to just use the ESM package instead of using the types mentioned in the documentation above I can do that. Let me know what you suggest. Thanks.
Dependencies from package.json
Ok, I see. That doc is for building a pure TypeScript project using the CDN. For create-react-app, you don't need to install the typings. Check out this sample here. It's not in TS, but same rules apply, you can use the default tsconfig from create-react-app and still be ok.
https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app