I am integrating typescript SDK with a simple typescript program the SDK is installed in the node modules it's tsconfig file looks like this
{
"include": ["src", "types"],
"compilerOptions": {
"module": "esnext",
"lib": ["esnext"],
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"rootDir": "./src",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"target": "ES2017",
"jsx": "react",
"esModuleInterop": true
}
}
and the package.json has following dependencies
"devDependencies": {
"stream-equal": "^2.0.1",
"tsdx": "^0.14.1",
"tslib": "^2.1.0",
"typescript": "^3.9.7"
}
When I am importing the SDK it is giving me error so I changed the module from commonJs to esnext & target to ES2017 so that it matches with the library /SDK installed but still error
ERROR in ../../../Downloads/MessageMedia(1)/dist/index.js 7:2-66
Module not found: Error: Can't resolve './messagemedialib.cjs.development.js' in 'C:\Users\User\Downloads\MessageMedia(1)\dist'
@ ./src/index.ts 12:0-77 13:19-25 18:31-49
ERROR in C:\Users\User\Desktop\WebpackTS\project1\src\index.ts
./src/index.ts 1:53-86
[tsl] ERROR in C:\Users\User\Desktop\WebpackTS\project1\src\index.ts(1,54)
TS7016: Could not find a declaration file for module '../node_modules/messagemedialib'. 'C:\Users\User\Desktop\WebpackTS\project1\node_modules\messagemedialib\dist\index.js' implicitly has an 'any' type.
2 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.64.0 compiled with 3 errors and 2 warnings in 3868 ms
I am using webpack for compilation