nest: error TS7019: Rest parameter 'args' implicitly has an 'any[]' type
I’m submitting a…
[ ] Regression
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Webpack + NestJS with help of ts-loader compiles with error
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\execution-context.interface.d.ts
(3,15): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\websockets\gateway-metadata-explorer.d.ts
(13,16): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\web-socket-adapter.interface.d.ts
(6,47): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\web-socket-adapter.interface.d.ts
(7,51): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\web-socket-adapter.interface.d.ts
(8,85): error TS7006: Parameter 'data' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\web-socket-adapter.interface.d.ts
(9,47): error TS7006: Parameter 'socket' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\web-socket-adapter.interface.d.ts
(9,55): error TS7006: Parameter 'next' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\pipe-transform.interface.d.ts
(5,21): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\custom-route-param-factory.interface.d.ts
(1,43): error TS7006: Parameter 'data' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\common\interfaces\custom-route-param-factory.interface.d.ts
(1,49): error TS7006: Parameter 'req' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\core\injector\module.d.ts
(14,18): error TS7019: Rest parameter 'args' implicitly has an 'any[]' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\microservices\client\client-proxy.d.ts
(4,63): error TS7006: Parameter 'err' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\microservices\client\client-proxy.d.ts
(4,68): error TS7006: Parameter 'result' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\microservices\client\client-proxy.d.ts
(6,58): error TS7006: Parameter 'err' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\microservices\client\client-proxy.d.ts
(6,63): error TS7006: Parameter 'result' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\microservices\interfaces\message-handlers.interface.d.ts
(3,25): error TS7006: Parameter 'data' implicitly has an 'any' type.
ERROR in c:\Workspace\market\node_modules\@nestjs\microservices\server\server.d.ts
(15,34): error TS7006: Parameter 'data' implicitly has an 'any' type.
Once tsconfig.json is set to noImplicitAny: false it will compile just fine.
Expected behavior
It should not allow implicit “any” and compile with noImplicitAny: true without errors
Minimal reproduction of the problem with instructions
tsconfig.json
{
"compilerOptions": {
"inlineSourceMap": true,
"inlineSources": true,
"target": "ES6",
"allowSyntheticDefaultImports": true,
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"strictNullChecks": true
}
}
webpack.config.js
var path = require ("path");
var webpack = require ("webpack");
module.exports = [{
name: "server",
target: "node",
devtool: "inline-source-map",
entry: {
"server": "./src/server/server.ts"
},
output: {
filename: "[name].js",
path: path.resolve (__dirname, "dist/server")
},
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
// '.ts', '.tsx', '.js', 'json', '.jsx'
extensions: [".ts", ".tsx", '.js']
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: "ts-loader" }
]
},
plugins: [
// Enables Scope Hoisting
// https://medium.com/webpack/webpack-3-official-release-15fd2dd8f07b
new webpack.optimize.ModuleConcatenationPlugin ()
]
}];
What is the motivation / use case for changing the behavior?
Environment
Nest version: 4.4.2
For Tooling issues:
- Node version: v8.1.2
- Platform: Windows
Others:
"ts-loader": "^2.2.2",
"typescript": "^2.4.1",
"webpack": "^3.10.0",
"@nestjs/common": "^4.4.2",
"@nestjs/core": "^4.4.2",
"@nestjs/microservices": "^4.4.1",
"@nestjs/testing": "^4.4.1",
"@nestjs/websockets": "^4.4.1",
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15 (10 by maintainers)
that repo is out of date. please use the cli or upgrade to nest v5
or you can set
skipLibCheckto true in tsconfig.