I am encountering difficulties while constructing a project (@red5/middleware)
that relies on another project (@red5/router)
, which in turn depends on the initial project (@red5/middleware)
.
When I execute the following command:
rm -rf types && tsc -p .
An error is thrown indicating that it cannot locate the .d.ts
file(s) due to their removal using rm
.
../router/types/Route.d.ts:4:28 - error TS7016: Could not find a declaration file for module '@red5/middleware'. 'C:/Users/rnaddy/Documents/vscode/projects/red5/framework/middleware/lib/index.js' implicitly has an 'any' type. Try
if available or include a new declaration (.d.ts) file withnpm install @types/red5__middleware
declare module '@red5/middleware';
@red5/router -> route.ts
import { Middleware } from '@red5/middleware';
If I omit the rm -rf types
command, errors are raised stating inability to overwrite the input file, but the previously mentioned error is no longer present.
What steps can I take to resolve this issue while still utilizing the rm -rf types
in my command?
middleware/tsconfig.json
{
"compilerOptions": {
"outDir": "lib",
"declarationDir": "types"
},
"extends": "../tsconfig.json",
"include": [
"src/**/*.ts"
]
}
tsconfig.json
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"strict": true,
"removeComments": false,
"inlineSourceMap": true
},
"exclude": [
"lib",
"types"
]
}