Cannot find name 'Omit' error occurs
See original GitHub issueI’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
TS2304: Cannot find name 'Omit'
error occurs when compiling using nest cli
So i tried tsc-watch -p tsconfig.build.json --onSuccess node dist/main.js
and dist/main.js
but it worked.
I found that the error only occurs when using nest cli
and it only affects in nest swagger
These are the commands I tried but got an error
nest build --watch --webpack
nest start
Here is my nest-cli.json
{
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"webpack": true,
"plugins": ["@nestjs/swagger/plugin"]
}
}
Expected behavior
Starting normally
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Nest version:
"@nestjs/common": "^6.10.12",
"@nestjs/core": "^6.10.12",
"@nestjs/platform-express": "^6.10.12",
"@nestjs/swagger": "^4.0.9"
"webpack-node-externals": "^1.7.2"
"nest cli" : "6.12.9"
For Tooling issues:
- Node version: 12.13.0
- Platform: Windows 10 education 1903
Others:
"typescript": "^3.7.2",
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Cannot find name 'Omit' in Typescript - Stack Overflow
Problem. I got error : Cannot find name 'Omit'. ts(2304) by VSCode Intellisense. But compile worked well.
Read more >TypeScript error: Cannot find name 'Omit' · Issue #1346 - GitHub
Error is coming from node_modules/react-intl/dist/components/injectIntl.d.ts . My TypeScript version is 3.4.5. Can you have a look, please?
Read more >How to Fix the “Cannot Find name 'describe'” Error in TypeScript
This error occurs when you try to use the describe() function in a TypeScript file, but TypeScript cannot find the type definitions for...
Read more >TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
Read more >TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kamilmysliwiec I found out that Nest is using the Global Cli for compilation. I face this error and the way to solve it it was uninstalling and reinstalling the global cli. Hope it works for you too.
@kamilmysliwiec I think this is because @nestjs/schematics has a peer dependency of
"peerDependencies": { "typescript": "^3.4.5" },
which doesn’t have Omit.