question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find name 'Omit' error occurs

See original GitHub issue

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

  • TS2304: Cannot find name 'Omit' error occurs when compiling using nest cli

image

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:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nicolashernandezamorcommented, Mar 3, 2020

@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.

1reaction
atjeffcommented, Jan 3, 2020

@kamilmysliwiec I think this is because @nestjs/schematics has a peer dependency of "peerDependencies": { "typescript": "^3.4.5" }, which doesn’t have Omit.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found