This issue can be frustrating as it doesn't affect the functionality of the program. However, upon opening a new or existing NestJS application, all imports are highlighted as errors.
For instance, in the main.ts
file, there are two imports:
import { NestFactory } from '@nestjs/core' // <-- (1)
import { AppModule } from './app.module' // <-- (2)
Error 1:
import-prefix-missing: Relative import path "@nestjs/core" not prefixed with / or ./ or ../ from "file:///Users/me/Documents/hello-world/src/main.ts
Error 2:
no-local: Unable to load a local module: "file:///Users/me/Documents/hello-world/src/app.module". Please check the file path.
These errors do not appear in VSCode or WebStorm. Upon researching, I found that these errors are typically associated with Deno/Python. Although I do not have Deno
installed, I do have python2 and python3 for Neovim.
When running the application, everything operates smoothly without any errors. Interestingly, I do not encounter this issue when using Express
or Koa
, regardless of whether I'm using typescript. This particular problem seems to be unique to NestJS.